Release 980315

Sun Mar 15 03:46:50 1998  Dimitrie O. Paun  <dimi@mail.cs.toronto.edu>

	* [*/*]
	Fixed some dprintf_ such that there is one and only one
	new line for each dprintf and that new line occurs at the end.
	Transformed some fprintfs into proper debug statements.
	Removed much redundancy from most of the debug statements. The
	redundancy appeared because now the component and function
	name is output automatically. Most debug statements also used to
	output the name of the function.
	All these changes prepared the source to switch completely to
	the new debugging interface.
	For more info, refer to ./documentation/debug-msg

Sat Mar 14 19:45:23 1997  Andreas Mohr <100.30936@germany.net>

	* [misc/shell.c] [if1632/kernel.spec]
	Changed parameters of FUNC004() to fix a crash.
	Not sure if this fix is correct (doc wanted).

	* [windows/user.c] [if1632/user.spec] [include/user.h]
	Implemented UserSeeUserDo.

	* [msdos/int21.c] [include/msdos.h]
	Added "GET LIST OF LISTS" (INT 21/52h).

Sat Mar 14 15:48:02 1998  Douglas Ridgway <ridgway@gmcl.com>

	* [include/windows.h] [relay32/gdi32.spec] [objects/enhmetafile.c]
	Beginnings of enhanced metafile support.

Fri Mar 13 20:53:09 1998  John Richardson <jrichard@zko.dec.com>

	* [win32/console.c]
	Restart interrupted console writes.

Fri Mar 13 18:59:24 1998  Matthew Becker <mbecker@glasscity.net>

	* [*/*.c]
	Updated documentation for API manpages.

	* [windows/dce.c]
	ReleaseDC16: Fixed cast.

	* [include/windows.h] [memory/virtual.c]
	VirtualQuery{Ex} should return DWORD instead of BOOL32.

Fri Mar 13 13:03:06 1998  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [README][documentation/status/]
	README updated, added lzexpand,version and multimedia
	status notes to new documentation/status directory.

	* [ole/*.c][if1632/typelib.spec]
	Added typelib stubs, several small additions and fixes.

	* [loader/pe_image.c]
	Fixed a small bug (fixup_imports got passed the wrong hModule in a
	remapcase).

	* [loader/signal.c][if1632/signal.c][misc/winsock_dns.c]
	  [loader/module.c]
	Fixed some recursive debugger crashes (caused by invalid FS).

	* [misc/registry.c]
	Two bugs fixed.

Fri Mar 13 04:55:01 1998  David Lee Lambert <lamber45@egr.msu.edu>

	* [include/winnt.h] [include/winnls.h]
	Moved LANG_xxx flags to winnls.h

	* [include/winnls.h]
	Added flags for GetDateFormat(); fixed validity of
	LOCALE_SYSTEM_DEFAULT.

	* [include/windows.h] 
	Added GetTimeFormat() prototypes.

	* [ole/ole2nls.c]
	Implemented ASCII date- and time-functions,  using an
	optimized common core;  added stubs for Unicode versions;  
	started work on a Unicode core.

	* [AUTHORS]
	Added my name.

Mon Mar  9 20:10:15 1998  Eric Kohl <ekohl@abo.rhein-zeitung.de>

	* [relay32/comctl32.spec] [include/imagelist.h]
	  [include/commctrl.h] [misc/imagelist.c] [misc/Makefile.in]
	First attempt at implementing ImageLists.

Sun Mar  8 20:19:49 1998  Uwe Bonnes  <bon@elektron.ikp.physik.tu-darmstadt.de>

	* [files/dos_fs.c] [configure.in]
	Try to get FileTimeToLocalFileTime,FileTimeToSystemTime and
	SystemTimeToFileTime right.
	Use timegm() where available.

	* [misc/lstr.c]
	Fix an off by one error in FormatMessage and handle the case 
	when args = NULL (used by programs to get the length of the 
	string).

	* [win32/console.c]
	Actual display a per-process Title string, better working
	attempt for WriteConsole32W and ReadConsole32W.

Fri Mar  6 20:33:45 1998  Slaven Rezic  <eserte@cs.tu-berlin.de>

	* [include/config.h.in][configure.in][multimedia/audio.c]
	  [multimedia/dsound.c]
	Added check for FreeBSD sound system.

Sun Mar  1 17:40:10 1998  Jason Schonberg <schon@mti.sgi.com>

	* [controls/edit.c] [include/ole.h] [include/shlobj.h]
	Removed final commas in enum types.

Mon Feb 23 07:52:18 1998  Luiz Otavio L. Zorzella  <zorzella@nr.conexware.com>

	* [multimedia/time.c]
	Workaround to avoid infinite recursion inside timeGetTime.

	* [multimedia/audio.c]
	WODM_GETNUMDEVS and WIDM_GETNUMDEVS only return 1 now if the
	SOUND_DEV can be opened, or if it's busy.
diff --git a/objects/Makefile.in b/objects/Makefile.in
index aecffd0..ef6cf87 100644
--- a/objects/Makefile.in
+++ b/objects/Makefile.in
@@ -14,6 +14,7 @@
 	dc.c \
 	dcvalues.c \
 	dib.c \
+	enhmetafile.c \
 	font.c \
 	gdiobj.c \
 	linedda.c \
diff --git a/objects/bitmap.c b/objects/bitmap.c
index df9bd2a..8b62e8d 100644
--- a/objects/bitmap.c
+++ b/objects/bitmap.c
@@ -142,7 +142,7 @@
     planes = (BYTE)planes;
     bpp    = (BYTE)bpp;
 
-    dprintf_info(gdi, "CreateBitmap: %dx%d, %d colors\n", 
+    TRACE(gdi, "%dx%d, %d colors\n", 
                  width, height, 1 << (planes*bpp) );
 
       /* Check parameters */
@@ -198,11 +198,11 @@
     HBITMAP32 hbmpRet = 0;
     DC *dc;
 
-    dprintf_info(gdi, "CreateCompatibleBitmap(%04x,%d,%d) = \n", 
+    TRACE(gdi, "(%04x,%d,%d) = \n", 
                  hdc, width, height );
     if (!(dc = DC_GetDCPtr( hdc ))) return 0;
     hbmpRet = CreateBitmap32( width, height, 1, dc->w.bitsPerPixel, NULL );
-    dprintf_info(gdi,"\t\t%04x\n", hbmpRet);
+    TRACE(gdi,"\t\t%04x\n", hbmpRet);
     return hbmpRet;
 }
 
@@ -271,7 +271,7 @@
     height = count / bmp->bitmap.bmWidthBytes;
     if (height > bmp->bitmap.bmHeight) height = bmp->bitmap.bmHeight;
 
-    dprintf_info(bitmap, "GetBitmapBits: %dx%d %d colors %p fetched height: %ld\n",
+    TRACE(bitmap, "%dx%d %d colors %p fetched height: %ld\n",
 	    bmp->bitmap.bmWidth, bmp->bitmap.bmHeight,
 	    1 << bmp->bitmap.bmBitsPixel, buffer, height );
 
@@ -394,7 +394,7 @@
     bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC );
     if (!bmp) return 0;
 
-    dprintf_info(bitmap, "SetBitmapBits: %dx%d %d colors %p\n",
+    TRACE(bitmap, "%dx%d %d colors %p\n",
 	    bmp->bitmap.bmWidth, bmp->bitmap.bmHeight,
 	    1 << bmp->bitmap.bmBitsPixel, buffer );
 
@@ -524,11 +524,11 @@
                               INT32 desiredx, INT32 desiredy, UINT32 loadflags)
 {
 	if (HIWORD(name)) {
-		dprintf_info(resource,"LoadImage32A(0x%04x,%s,%d,%d,%d,0x%08x)\n",
+		TRACE(resource,"(0x%04x,%s,%d,%d,%d,0x%08x)\n",
 			hinst,name,type,desiredx,desiredy,loadflags
 		);
 	} else {
-		dprintf_info(resource,"LoadImage32A(0x%04x,%p,%d,%d,%d,0x%08x)\n",
+		TRACE(resource,"(0x%04x,%p,%d,%d,%d,0x%08x)\n",
 			hinst,name,type,desiredx,desiredy,loadflags
 		);
 	}
@@ -547,11 +547,11 @@
                               INT32 desiredx, INT32 desiredy, UINT32 loadflags)
 {
 	if (HIWORD(name)) {
-		dprintf_info(resource,"LoadImage32W(0x%04x,%p,%d,%d,%d,0x%08x)\n",
+		TRACE(resource,"(0x%04x,%p,%d,%d,%d,0x%08x)\n",
 			hinst,name,type,desiredx,desiredy,loadflags
 		);
 	} else {
-		dprintf_info(resource,"LoadImage32W(0x%04x,%p,%d,%d,%d,0x%08x)\n",
+		TRACE(resource,"(0x%04x,%p,%d,%d,%d,0x%08x)\n",
 			hinst,name,type,desiredx,desiredy,loadflags
 		);
 	}
@@ -619,11 +619,11 @@
     if (HIWORD(name))
     {
         char *str = (char *)PTR_SEG_TO_LIN( name );
-        dprintf_info(bitmap, "LoadBitmap16(%04x,'%s')\n", instance, str );
+        TRACE(bitmap, "(%04x,'%s')\n", instance, str );
         if (str[0] == '#') name = (SEGPTR)(DWORD)(WORD)atoi( str + 1 );
     }
     else
-        dprintf_info(bitmap, "LoadBitmap16(%04x,%04x)\n",
+        TRACE(bitmap, "(%04x,%04x)\n",
                         instance, LOWORD(name) );
 
     if (!instance)  /* OEM bitmap */
diff --git a/objects/brush.c b/objects/brush.c
index af68d4c..7add6d2 100644
--- a/objects/brush.c
+++ b/objects/brush.c
@@ -52,7 +52,7 @@
 HBRUSH16 WINAPI CreateHatchBrush16( INT16 style, COLORREF color )
 {
     LOGBRUSH32 logbrush = { BS_HATCHED, color, style };
-    dprintf_info(gdi, "CreateHatchBrush16: %d %06lx\n", style, color );
+    TRACE(gdi, "%d %06lx\n", style, color );
     if ((style < 0) || (style >= NB_HATCH_STYLES)) return 0;
     return CreateBrushIndirect32( &logbrush );
 }
@@ -64,7 +64,7 @@
 HBRUSH32 WINAPI CreateHatchBrush32( INT32 style, COLORREF color )
 {
     LOGBRUSH32 logbrush = { BS_HATCHED, color, style };
-    dprintf_info(gdi, "CreateHatchBrush32: %d %06lx\n", style, color );
+    TRACE(gdi, "%d %06lx\n", style, color );
     if ((style < 0) || (style >= NB_HATCH_STYLES)) return 0;
     return CreateBrushIndirect32( &logbrush );
 }
@@ -87,7 +87,7 @@
     LOGBRUSH32 logbrush = { BS_PATTERN, 0, 0 };
     BITMAPOBJ *bmp, *newbmp;
 
-    dprintf_info(gdi, "CreatePatternBrush: %04x\n", hbitmap );
+    TRACE(gdi, "%04x\n", hbitmap );
 
       /* Make a copy of the bitmap */
 
@@ -118,7 +118,7 @@
     BITMAPINFO *info, *newInfo;
     INT32 size;
     
-    dprintf_info(gdi, "CreateDIBPatternBrush: %04x\n", hbitmap );
+    TRACE(gdi, "%04x\n", hbitmap );
 
       /* Make a copy of the bitmap */
 
@@ -153,7 +153,7 @@
     BITMAPINFO *info, *newInfo;
     INT32 size;
     
-    dprintf_info(gdi, "CreateDIBPatternBrush: %04x\n", hbitmap );
+    TRACE(gdi, "%04x\n", hbitmap );
 
       /* Make a copy of the bitmap */
 
@@ -185,7 +185,7 @@
 HBRUSH16 WINAPI CreateSolidBrush16( COLORREF color )
 {
     LOGBRUSH32 logbrush = { BS_SOLID, color, 0 };
-    dprintf_info(gdi, "CreateSolidBrush16: %06lx\n", color );
+    TRACE(gdi, "%06lx\n", color );
     return CreateBrushIndirect32( &logbrush );
 }
 
@@ -196,7 +196,7 @@
 HBRUSH32 WINAPI CreateSolidBrush32( COLORREF color )
 {
     LOGBRUSH32 logbrush = { BS_SOLID, color, 0 };
-    dprintf_info(gdi, "CreateSolidBrush32: %06lx\n", color );
+    TRACE(gdi, "%06lx\n", color );
     return CreateBrushIndirect32( &logbrush );
 }
 
diff --git a/objects/clipping.c b/objects/clipping.c
index c435711..1736092 100644
--- a/objects/clipping.c
+++ b/objects/clipping.c
@@ -65,7 +65,7 @@
     DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
     if (!dc) return ERROR;
 
-    dprintf_info(clipping, "SelectClipRgn: %04x %04x\n", hdc, hrgn );
+    TRACE(clipping, "%04x %04x\n", hdc, hrgn );
 
     if (hrgn)
     {
@@ -94,7 +94,7 @@
     DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
     if (!dc || !hrgn) return ERROR;
 
-    dprintf_info(clipping, "SelectVisRgn: %04x %04x\n", hdc, hrgn );
+    TRACE(clipping, "%04x %04x\n", hdc, hrgn );
 
     dc->w.flags &= ~DC_DIRTY;
 
@@ -129,7 +129,7 @@
 	return NULLREGION;   /* ?? */
     }
 
-    dprintf_info(clipping, "OffsetClipRgn: %04x %d,%d\n", hdc, x, y );
+    TRACE(clipping, "%04x %d,%d\n", hdc, x, y );
 
     if (dc->w.hClipRgn)
     {
@@ -151,7 +151,7 @@
     INT16 retval;
     DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
     if (!dc) return ERROR;    
-    dprintf_info(clipping, "OffsetVisRgn: %04x %d,%d\n", hdc, x, y );
+    TRACE(clipping, "%04x %d,%d\n", hdc, x, y );
     retval = OffsetRgn32( dc->w.hVisRgn, x, y );
     CLIPPING_UpdateGCRegion( dc );
     GDI_HEAP_UNLOCK( hdc );
@@ -228,7 +228,7 @@
     top    = YLPTODP( dc, top );
     bottom = YLPTODP( dc, bottom );
 
-    dprintf_info(clipping, "ExcludeClipRect: %04x %dx%d,%dx%d\n",
+    TRACE(clipping, "%04x %dx%d,%dx%d\n",
 	    hdc, left, top, right, bottom );
     ret = CLIPPING_IntersectClipRect( dc, left, top, right, bottom, CLIP_EXCLUDE );
     GDI_HEAP_UNLOCK( hdc );
@@ -268,7 +268,7 @@
     top    = YLPTODP( dc, top );
     bottom = YLPTODP( dc, bottom );
 
-    dprintf_info(clipping, "IntersectClipRect: %04x %dx%d,%dx%d\n",
+    TRACE(clipping, "%04x %dx%d,%dx%d\n",
 	    hdc, left, top, right, bottom );
     ret = CLIPPING_IntersectClipRect( dc, left, top, right, bottom, CLIP_INTERSECT );
     GDI_HEAP_UNLOCK( hdc );
@@ -326,7 +326,7 @@
 {
     DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
     if (!dc) return ERROR;    
-    dprintf_info(clipping, "ExcludeVisRect: %04x %dx%d,%dx%d\n",
+    TRACE(clipping, "%04x %dx%d,%dx%d\n",
 	    hdc, left, top, right, bottom );
 
     return CLIPPING_IntersectVisRect( dc, left, top, right, bottom, TRUE );
@@ -341,7 +341,7 @@
 {
     DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
     if (!dc) return ERROR;    
-    dprintf_info(clipping, "IntersectVisRect: %04x %dx%d,%dx%d\n",
+    TRACE(clipping, "%04x %dx%d,%dx%d\n",
 	    hdc, left, top, right, bottom );
 
     return CLIPPING_IntersectVisRect( dc, left, top, right, bottom, FALSE );
@@ -365,7 +365,7 @@
     DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
     if (!dc) return ERROR;    
 
-    dprintf_info(clipping, "PtVisible: %04x %d,%d\n", hdc, x, y );
+    TRACE(clipping, "%04x %d,%d\n", hdc, x, y );
     if (!dc->w.hGCClipRgn) return FALSE;
 
     if( dc->w.flags & DC_DIRTY ) UPDATE_DIRTY_DC(dc);
@@ -383,7 +383,7 @@
     RECT16 tmpRect;
     DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
     if (!dc) return FALSE;
-    dprintf_info(clipping,"RectVisible: %04x %d,%dx%d,%d\n",
+    TRACE(clipping,"%04x %d,%dx%d,%d\n",
                      hdc, rect->left, rect->top, rect->right, rect->bottom );
     if (!dc->w.hGCClipRgn) return FALSE;
     /* copy rectangle to avoid overwriting by LPtoDP */
@@ -460,7 +460,7 @@
     RGNOBJ *obj, *copyObj;
     DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
     if (!dc) return 0;
-    dprintf_info(clipping, "SaveVisRgn: %04x\n", hdc );
+    TRACE(clipping, "%04x\n", hdc );
     if (!dc->w.hVisRgn)
     {
         fprintf( stderr, "SaveVisRgn: hVisRgn is zero. Please report this.\n" );
@@ -512,7 +512,7 @@
         GDI_HEAP_UNLOCK( hdc );
         return ERROR;    
     }
-    dprintf_info(clipping, "RestoreVisRgn: %04x\n", hdc );
+    TRACE(clipping, "%04x\n", hdc );
     if (!(obj = (RGNOBJ *) GDI_GetObjPtr( dc->w.hVisRgn, REGION_MAGIC )))
     {
         GDI_HEAP_UNLOCK( hdc );
diff --git a/objects/color.c b/objects/color.c
index 6399d39..9f37ebc 100644
--- a/objects/color.c
+++ b/objects/color.c
@@ -288,7 +288,7 @@
 
     COLOR_sysPal = (PALETTEENTRY*)xmalloc(sizeof(PALETTEENTRY)*cs->size);
 
-    dprintf_info(palette,"\tbuilding private map - %i palette entries\n", cs->size);
+    TRACE(palette,"\tbuilding private map - %i palette entries\n", cs->size);
 
       /* Allocate system palette colors */ 
 
@@ -345,9 +345,9 @@
    COLOR_max = PROFILE_GetWineIniInt( "options", "AllocSystemColors", 256);
    if (COLOR_max > 256) COLOR_max = 256;
    else if (COLOR_max < 20) COLOR_max = 20;
-   dprintf_info(palette,"COLOR_Init: %d colors configured.\n", COLOR_max);
+   TRACE(palette,"%d colors configured.\n", COLOR_max);
    
-   dprintf_info(palette,"\tbuilding shared map - %i palette entries\n", cs->size);
+   TRACE(palette,"\tbuilding shared map - %i palette entries\n", cs->size);
 
    /* Be nice and allocate system colors as read-only */
 
@@ -364,7 +364,7 @@
 	     
              if( !warn++ ) 
 	     {
-		  dprintf_warn(palette, "Not enough colors for the full system palette.\n");
+		  WARN(palette, "Not enough colors for the full system palette.\n");
 
 	          bp = BlackPixel(display, DefaultScreen(display));
 	          wp = WhitePixel(display, DefaultScreen(display));
@@ -402,7 +402,7 @@
 
         sysPixel[i] = color.pixel;
 
-        dprintf_info(palette,"\tsyscolor(%lx) -> pixel %i\n",
+        TRACE(palette,"\tsyscolor(%lx) -> pixel %i\n",
 		      *(COLORREF*)(__sysPalTemplate+i), (int)color.pixel);
 
         /* Set EGA mapping if color in the first or last eight */
@@ -419,7 +419,7 @@
      {
 	int c_min = 0, c_max = cs->size, c_val;
 
-	dprintf_info(palette,"\tdynamic colormap... \n");
+	TRACE(palette,"\tdynamic colormap... \n");
 
 	/* comment this out if you want to debug palette init */
 
@@ -461,7 +461,7 @@
 
 	TSXUngrabServer(display);
 
-	dprintf_info(palette,"adjusted size %i colorcells\n", cs->size);
+	TRACE(palette,"adjusted size %i colorcells\n", cs->size);
      }
    else if( cSpace.flags & COLOR_VIRTUAL ) 
 	{
@@ -470,12 +470,12 @@
 	   * to maintain compatibility
 	   */
 	  cs->size = 256;
-	  dprintf_info(palette,"\tvirtual colorspace - screendepth %i\n", screenDepth);
+	  TRACE(palette,"\tvirtual colorspace - screendepth %i\n", screenDepth);
 	}
    else cs->size = NB_RESERVED_COLORS;	/* system palette only - however we can alloc a bunch
 			                 * of colors and map to them */
 
-   dprintf_info(palette,"Shared system palette uses %i colors.\n", cs->size);
+   TRACE(palette,"Shared system palette uses %i colors.\n", cs->size);
 
    /* set gap to account for pixel shortage. It has to be right in the center
     * of the system palette because otherwise raster ops get screwed. */
@@ -529,7 +529,7 @@
            else
              COLOR_PaletteToPixel[i] = i;
 
-      dprintf_info(palette,"\tindex %i -> pixel %i\n", i, COLOR_PaletteToPixel[i]);
+      TRACE(palette,"\tindex %i -> pixel %i\n", i, COLOR_PaletteToPixel[i]);
 
       if( COLOR_PixelToPalette )
           COLOR_PixelToPalette[COLOR_PaletteToPixel[i]] = i;
@@ -574,7 +574,7 @@
 
     visual = DefaultVisual( display, DefaultScreen(display) );
 
-    dprintf_info(palette,"COLOR_Init: initializing palette manager...\n");
+    TRACE(palette,"initializing palette manager...\n");
 
     white = WhitePixelOfScreen( screen );
     black = BlackPixelOfScreen( screen );
@@ -649,7 +649,7 @@
     }
     }
 
-    dprintf_info(palette," visual class %i (%i)\n", 
+    TRACE(palette," visual class %i (%i)\n", 
 		    visual->class, cSpace.monoPlane);
 
     memset(COLOR_freeList, 0, 256*sizeof(unsigned char));
@@ -941,7 +941,7 @@
 
 	if( !palPtr ) return 0;
 	else if( !palPtr->mapping ) 
-            dprintf_warn(palette, "\tpalette %04x is not realized\n", dc->w.hPalette);
+            WARN(palette, "\tpalette %04x is not realized\n", dc->w.hPalette);
 
 	switch(spec_type)	/* we have to peruse DC and system palette */
     	{
@@ -960,7 +960,7 @@
 	    	index = COLOR_PaletteLookupPixel( COLOR_sysPal, 256, 
 						  COLOR_PaletteToPixel, color, FALSE);
 
-		/* dprintf_info(palette,"\tRGB(%lx) -> pixel %i\n", color, index);
+		/* TRACE(palette,"\tRGB(%lx) -> pixel %i\n", color, index);
 		 */
 	    	break;
        	    case 1:  /* PALETTEINDEX */
@@ -970,14 +970,14 @@
 		    fprintf(stderr, "\tRGB(%lx) : index %i is out of bounds\n", color, index); 
 		else if( palPtr->mapping ) index = palPtr->mapping[index];
 
-		/*  dprintf_info(palette,"\tPALETTEINDEX(%04x) -> pixel %i\n", (WORD)color, index);
+		/*  TRACE(palette,"\tPALETTEINDEX(%04x) -> pixel %i\n", (WORD)color, index);
 		 */
 		break;
             case 2:  /* PALETTERGB */
 		index = COLOR_PaletteLookupPixel( palPtr->logpalette.palPalEntry, 
                                              palPtr->logpalette.palNumEntries,
                                              palPtr->mapping, color, FALSE);
-		/* dprintf_info(palette,"\tPALETTERGB(%lx) -> pixel %i\n", color, index);
+		/* TRACE(palette,"\tPALETTERGB(%lx) -> pixel %i\n", color, index);
 		 */
 		break;
 	}
@@ -1077,7 +1077,7 @@
         if( !prevMapping || palPtr->mapping[uStart] != index ) iRemapped++;
         palPtr->mapping[uStart] = index;
 
-        dprintf_info(palette,"\tentry %i (%lx) -> pixel %i\n", uStart, 
+        TRACE(palette,"\tentry %i (%lx) -> pixel %i\n", uStart, 
 				*(COLORREF*)(palPtr->logpalette.palPalEntry + uStart), index);
 	
     }
diff --git a/objects/cursoricon.c b/objects/cursoricon.c
index db23574..f1bb32b 100644
--- a/objects/cursoricon.c
+++ b/objects/cursoricon.c
@@ -289,7 +289,7 @@
     BITMAPINFO *bmi;
     HDC32 hdc;
 
-    dprintf_info(cursor,"CreateFromResource: %08x (%u bytes), ver %08x, %ix%i %s %s\n",
+    TRACE(cursor,"%08x (%u bytes), ver %08x, %ix%i %s %s\n",
                         (unsigned)bits, cbSize, (unsigned)dwVersion, width, height,
                                   bIcon ? "icon" : "cursor", cFlag ? "mono" : "" );
     if (dwVersion == 0x00020000)
@@ -440,22 +440,21 @@
 }
 
 
- /**********************************************************************
- *          CreateIconFromResource          (USER32)
+/**********************************************************************
+ *          CreateIconFromResource          (USER32.???)
+ * FIXME:
+ *  	bon@elektron.ikp.physik.tu-darmstadt.de 971130: Test with weditres
+ *	showed only blank layout. Couldn't determine if this is a problem
+ *	with CreateIconFromResource32 or the application. The application
+ *	windows behaves strange (no redraw) before CreateIconFromResource32
  */
 HICON32 WINAPI CreateIconFromResource32( LPBYTE bits, UINT32 cbSize,
                                            BOOL32 bIcon, DWORD dwVersion)
-/*FIXME: bon@elektron.ikp.physik.tu-darmstadt.de 971130: Test with weditres
-	 showed only blank layout. Couldn't determine if this is a problem
-	 with CreateIconFromResource32 or the application. The application
-	 windows behaves strange (no redraw) before  CreateIconFromResource32
-*/
 {
     HICON32 ret;
     ret = CreateIconFromResourceEx16( bits, cbSize, bIcon, dwVersion, 0,0,0);
-    fprintf(stdnimp,"CreateIconFromResource3 probably only a stub\n");
-    dprintf_info(icon, 
-	"CreateIconFromResource32 %s at %p size %d winver %d return 0x%04x\n",
+    FIXME(icon,"probably only a stub\n");
+    TRACE(icon, "%s at %p size %d winver %d return 0x%04x\n",
                  (bIcon)?"Icon":"Cursor",bits,cbSize,bIcon,ret);
     return ret;
 }
@@ -637,7 +636,7 @@
            COLORREF       col;
            CURSORICONINFO cI;
 
-	   dprintf_info(icon, "IconToCursor:[%04x] %ix%i %ibpp (bogus %ibps)\n", 
+	   TRACE(icon, "[%04x] %ix%i %ibpp (bogus %ibps)\n", 
 		hIcon, pIcon->nWidth, pIcon->nHeight, pIcon->bBitsPerPixel, pIcon->nWidthBytes );
 
 	   xor_width = BITMAP_GetBitsWidth( pIcon->nWidth, bpp );
@@ -704,10 +703,10 @@
 HCURSOR16 WINAPI LoadCursor16( HINSTANCE16 hInstance, SEGPTR name )
 {
     if (HIWORD(name))
-        dprintf_info(cursor, "LoadCursor16: %04x '%s'\n",
+        TRACE(cursor, "%04x '%s'\n",
                         hInstance, (char *)PTR_SEG_TO_LIN( name ) );
     else
-        dprintf_info(cursor, "LoadCursor16: %04x %04x\n",
+        TRACE(cursor, "%04x %04x\n",
                         hInstance, LOWORD(name) );
 
     return CURSORICON_Load16( hInstance, name,
@@ -721,10 +720,10 @@
 HICON16 WINAPI LoadIcon16( HINSTANCE16 hInstance, SEGPTR name )
 {
     if (HIWORD(name))
-        dprintf_info(icon, "LoadIcon: %04x '%s'\n",
+        TRACE(icon, "%04x '%s'\n",
                       hInstance, (char *)PTR_SEG_TO_LIN( name ) );
     else
-        dprintf_info(icon, "LoadIcon: %04x %04x\n",
+        TRACE(icon, "%04x %04x\n",
                       hInstance, LOWORD(name) );
 
     return CURSORICON_Load16( hInstance, name,
@@ -743,7 +742,7 @@
 {
     CURSORICONINFO info = { { xHotSpot, yHotSpot }, nWidth, nHeight, 0, 1, 1 };
 
-    dprintf_info(cursor, "CreateCursor: %dx%d spot=%d,%d xor=%p and=%p\n",
+    TRACE(cursor, "%dx%d spot=%d,%d xor=%p and=%p\n",
                     nWidth, nHeight, xHotSpot, yHotSpot, lpXORbits, lpANDbits);
     return CreateCursorIconIndirect( hInstance, &info, lpANDbits, lpXORbits );
 }
@@ -759,7 +758,7 @@
 {
     CURSORICONINFO info = { { xHotSpot, yHotSpot }, nWidth, nHeight, 0, 1, 1 };
 
-    dprintf_info(cursor, "CreateCursor: %dx%d spot=%d,%d xor=%p and=%p\n",
+    TRACE(cursor, "%dx%d spot=%d,%d xor=%p and=%p\n",
                     nWidth, nHeight, xHotSpot, yHotSpot, lpXORbits, lpANDbits);
     return CreateCursorIconIndirect( MODULE_HANDLEtoHMODULE16( hInstance ),
                                      &info, lpANDbits, lpXORbits );
@@ -775,7 +774,7 @@
 {
     CURSORICONINFO info = { { 0, 0 }, nWidth, nHeight, 0, bPlanes, bBitsPixel};
 
-    dprintf_info(icon, "CreateIcon: %dx%dx%d, xor=%p, and=%p\n",
+    TRACE(icon, "%dx%dx%d, xor=%p, and=%p\n",
                   nWidth, nHeight, bPlanes * bBitsPixel, lpXORbits, lpANDbits);
     return CreateCursorIconIndirect( hInstance, &info, lpANDbits, lpXORbits );
 }
@@ -790,7 +789,7 @@
 {
     CURSORICONINFO info = { { 0, 0 }, nWidth, nHeight, 0, bPlanes, bBitsPixel};
 
-    dprintf_info(icon, "CreateIcon: %dx%dx%d, xor=%p, and=%p\n",
+    TRACE(icon, "%dx%dx%d, xor=%p, and=%p\n",
                   nWidth, nHeight, bPlanes * bBitsPixel, lpXORbits, lpANDbits);
     return CreateCursorIconIndirect( MODULE_HANDLEtoHMODULE16( hInstance ),
                                      &info, lpANDbits, lpXORbits );
@@ -831,7 +830,7 @@
  */
 HICON16 WINAPI CopyIcon16( HINSTANCE16 hInstance, HICON16 hIcon )
 {
-    dprintf_info(icon, "CopyIcon16: %04x %04x\n", hInstance, hIcon );
+    TRACE(icon, "%04x %04x\n", hInstance, hIcon );
     return CURSORICON_Copy( hInstance, hIcon );
 }
 
@@ -843,7 +842,7 @@
 {
   HTASK16 hTask = GetCurrentTask ();
   TDB* pTask = (TDB *) GlobalLock16 (hTask);
-    dprintf_info(icon, "CopyIcon32: %04x\n", hIcon );
+    TRACE(icon, "%04x\n", hIcon );
   return CURSORICON_Copy( pTask->hInstance, hIcon );
 }
 
@@ -853,7 +852,7 @@
  */
 HCURSOR16 WINAPI CopyCursor16( HINSTANCE16 hInstance, HCURSOR16 hCursor )
 {
-    dprintf_info(cursor, "CopyCursor16: %04x %04x\n", hInstance, hCursor );
+    TRACE(cursor, "%04x %04x\n", hInstance, hCursor );
     return CURSORICON_Copy( hInstance, hCursor );
 }
 
@@ -872,7 +871,7 @@
  */
 BOOL32 WINAPI DestroyIcon32( HICON32 hIcon )
 {
-    dprintf_info(icon, "DestroyIcon: %04x\n", hIcon );
+    TRACE(icon, "%04x\n", hIcon );
     /* FIXME: should check for OEM icon here */
     return (FreeResource16( hIcon ) == 0);
 }
@@ -892,7 +891,7 @@
  */
 BOOL32 WINAPI DestroyCursor32( HCURSOR32 hCursor )
 {
-    dprintf_info(cursor, "DestroyCursor: %04x\n", hCursor );
+    TRACE(cursor, "%04x\n", hCursor );
     /* FIXME: should check for OEM cursor here */
     return (FreeResource16( hCursor ) == 0);
 }
@@ -1119,13 +1118,16 @@
 
 /***********************************************************************
  *           SetCursor32    (USER32.471)
+ * RETURNS:
+ *	A handle to the previous cursor shape.
  */
-HCURSOR32 WINAPI SetCursor32( HCURSOR32 hCursor )
-{
+HCURSOR32 WINAPI SetCursor32(
+	         HCURSOR32 hCursor /* Handle of cursor to show */
+) {
     HCURSOR32 hOldCursor;
 
     if (hCursor == hActiveCursor) return hActiveCursor;  /* No change */
-    dprintf_info(cursor, "SetCursor: %04x\n", hCursor );
+    TRACE(cursor, "%04x\n", hCursor );
     hOldCursor = hActiveCursor;
     hActiveCursor = hCursor;
     /* Change the cursor shape only if it is visible */
@@ -1153,7 +1155,7 @@
  */
 BOOL32 WINAPI SetCursorPos32( INT32 x, INT32 y )
 {
-    dprintf_info(cursor, "SetCursorPos: x=%d y=%d\n", x, y );
+    TRACE(cursor, "x=%d y=%d\n", x, y );
     TSXWarpPointer( display, rootWindow, rootWindow, 0, 0, 0, 0, x, y );
     return TRUE;
 }
@@ -1173,7 +1175,7 @@
  */
 INT32 WINAPI ShowCursor32( BOOL32 bShow )
 {
-    dprintf_info(cursor, "ShowCursor: %d, count=%d\n",
+    TRACE(cursor, "%d, count=%d\n",
                     bShow, CURSOR_ShowCount );
 
     EnterCriticalSection( &X11DRV_CritSection );
@@ -1262,7 +1264,7 @@
         else
             MouseButtonsStates[2] = FALSE;
     }
-    dprintf_info(cursor, "GetCursorPos: ret=%d,%d\n", pt->x, pt->y );
+    TRACE(cursor, "ret=%d,%d\n", pt->x, pt->y );
 }
 
 
@@ -1320,7 +1322,7 @@
 	    if( entry ) retVal = entry->wResId;
 	}
     }
-    else dprintf_warn(cursor, "IconId: invalid resource directory\n");
+    else WARN(cursor, "invalid resource directory\n");
     return retVal;
 }
 
@@ -1360,7 +1362,7 @@
 {
     LPBYTE lpDir = (LPBYTE)GlobalLock16(hResource);
 
-    dprintf_info(cursor, "GetIconID: hRes=%04x, entries=%i\n",
+    TRACE(cursor, "hRes=%04x, entries=%i\n",
                     hResource, lpDir ? ((CURSORICONDIR*)lpDir)->idCount : 0);
 
     switch(resType)
@@ -1438,7 +1440,7 @@
 {
     LPBYTE bits = (LPBYTE)LockResource16( hResource );
 
-    dprintf_info(cursor,"LoadIconHandler: hRes=%04x\n",hResource);
+    TRACE(cursor,"hRes=%04x\n",hResource);
 
     return CURSORICON_CreateFromResource( 0, 0, bits, 0, TRUE, 
 		      bNew ? 0x00030000 : 0x00020000, 0, 0, LR_DEFAULTCOLOR );
@@ -1576,7 +1578,7 @@
     HDC32 hMemDC = CreateCompatibleDC32 (hdc);
     BOOL32 result = FALSE;
 
-    dprintf_fixme(icon, "DrawIconEx32: part stub.\n");
+    FIXME(icon, "part stub.\n");
 
     if (hMemDC && ptr)
     {
diff --git a/objects/dc.c b/objects/dc.c
index 70a65c7..8db9adc 100644
--- a/objects/dc.c
+++ b/objects/dc.c
@@ -449,7 +449,7 @@
     }
     newdc = (DC *) GDI_HEAP_LOCK( handle );
 
-    dprintf_info(dc, "GetDCState(%04x): returning %04x\n", hdc, handle );
+    TRACE(dc, "(%04x): returning %04x\n", hdc, handle );
 
     memset( &newdc->u.x, 0, sizeof(newdc->u.x) );
     newdc->w.flags           = dc->w.flags | DC_SAVED;
@@ -537,7 +537,7 @@
       GDI_HEAP_UNLOCK( hdcs );
       return;
     }
-    dprintf_info(dc, "SetDCState: %04x %04x\n", hdc, hdcs );
+    TRACE(dc, "%04x %04x\n", hdc, hdcs );
 
     dc->w.flags           = dcs->w.flags & ~DC_SAVED;
     dc->w.devCaps         = dcs->w.devCaps;
@@ -642,7 +642,7 @@
     
     dcs->header.hNext = dc->header.hNext;
     dc->header.hNext = hdcs;
-    dprintf_info(dc, "SaveDC(%04x): returning %d\n", hdc, dc->saveLevel+1 );
+    TRACE(dc, "(%04x): returning %d\n", hdc, dc->saveLevel+1 );
     ret = ++dc->saveLevel;
     GDI_HEAP_UNLOCK( hdcs );
     GDI_HEAP_UNLOCK( hdc );
@@ -667,7 +667,7 @@
     DC * dc, * dcs;
     BOOL32 success;
 
-    dprintf_info(dc, "RestoreDC: %04x %d\n", hdc, level );
+    TRACE(dc, "%04x %d\n", hdc, level );
     dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
     if (!dc) 
     {
@@ -727,13 +727,13 @@
     if (!(dc = DC_AllocDC( funcs ))) return 0;
     dc->w.flags = 0;
 
-    dprintf_info(dc, "CreateDC(%s %s %s): returning %04x\n",
+    TRACE(dc, "(%s %s %s): returning %04x\n",
                driver, device, output, dc->hSelf );
 
     if (dc->funcs->pCreateDC &&
         !dc->funcs->pCreateDC( dc, driver, device, output, initData ))
     {
-        dprintf_warn(dc, "CreateDC: creation aborted by device\n" );
+        WARN(dc, "creation aborted by device\n" );
         GDI_HEAP_FREE( dc->hSelf );
         return 0;
     }
@@ -829,7 +829,7 @@
 
     if (!(dc = DC_AllocDC( funcs ))) return 0;
 
-    dprintf_info(dc, "CreateCompatibleDC(%04x): returning %04x\n",
+    TRACE(dc, "(%04x): returning %04x\n",
                hdc, dc->hSelf );
 
       /* Create default bitmap */
@@ -846,7 +846,7 @@
     if (dc->funcs->pCreateDC &&
         !dc->funcs->pCreateDC( dc, NULL, NULL, NULL, NULL ))
     {
-        dprintf_warn(dc, "CreateCompatibleDC: creation aborted by device\n");
+        WARN(dc, "creation aborted by device\n");
         DeleteObject32( hbitmap );
         GDI_HEAP_FREE( dc->hSelf );
         return 0;
@@ -875,7 +875,7 @@
     DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
     if (!dc) return FALSE;
 
-    dprintf_info(dc, "DeleteDC: %04x\n", hdc );
+    TRACE(dc, "%04x\n", hdc );
 
     while (dc->saveLevel)
     {
@@ -961,7 +961,7 @@
       return 0;
     }
     
-    dprintf_info(dc, "GetDeviceCaps(%04x,%d): returning %d\n",
+    TRACE(dc, "(%04x,%d): returning %d\n",
 	    hdc, cap, *(WORD *)(((char *)dc->w.devCaps) + cap) );
     ret = *(WORD *)(((char *)dc->w.devCaps) + cap);
     GDI_HEAP_UNLOCK( hdc );
@@ -1208,9 +1208,10 @@
 
 /***********************************************************************
  *           GetWorldTransform    (GDI32.244)
+ * FIXME
+ *	Check that SetLastError is being called correctly
  */
 BOOL32 WINAPI GetWorldTransform( HDC32 hdc, LPXFORM xform )
-/* FIXME: Check that SetLastError is being called correctly */
 {
     DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
     
@@ -1268,7 +1269,7 @@
 {
     DC *dc = (DC *)GDI_GetObjPtr( hdc, DC_MAGIC );
 
-    dprintf_info(dc, "SetDCHook: hookProc %08x, default is %08x\n",
+    TRACE(dc, "hookProc %08x, default is %08x\n",
                 (UINT32)hookProc, (UINT32)DCHook );
 
     if (!dc) return FALSE;
@@ -1306,7 +1307,7 @@
         /* "Undocumented Windows" info is slightly confusing.
          */
 
-        dprintf_info(dc,"SetHookFlags: hDC %04x, flags %04x\n",hDC,flags);
+        TRACE(dc,"hDC %04x, flags %04x\n",hDC,flags);
 
         if( flags & DCHF_INVALIDATEVISRGN )
             dc->w.flags |= DC_DIRTY;
diff --git a/objects/dib.c b/objects/dib.c
index 1622d17..7dd033f 100644
--- a/objects/dib.c
+++ b/objects/dib.c
@@ -577,10 +577,8 @@
 			  line 	-= (*pIn++);
 			  if (line == 0)
 			    {
-			      dprintf_info(bitmap, 
-					     "DIB_SetImageBits_RLE8(): "
-					     "Delta to last line of bitmap "
-					     "(wrongly?) causes loop exit\n");
+			      TRACE(bitmap, "Delta to last line of bitmap "
+					   "(wrongly?) causes loop exit\n");
 			    }
 			  break;
 		      }
@@ -624,7 +622,7 @@
      */
     if ( (*(pIn-2) != 0/*escape*/) || (*(pIn-1)!= RleEnd) )
       {
-	dprintf_info(bitmap, "DIB_SetImageBits_RLE8(): End-of-bitmap "
+	TRACE(bitmap, "End-of-bitmap "
 		       "without (strictly) proper escape code.  Last two "
 		       "bytes were: %02X %02X.\n",
 		       (int)*(pIn-2),
@@ -1179,7 +1177,7 @@
 	BYTE*	bbits = bits;
 	int	pad, yend, xend = bmp->bitmap.bmWidth;
 
-        dprintf_info(bitmap, "GetDIBits: %u scanlines of (%i,%i) -> (%i,%i) starting from %u\n",
+        TRACE(bitmap, "%u scanlines of (%i,%i) -> (%i,%i) starting from %u\n",
 			    lines, bmp->bitmap.bmWidth, bmp->bitmap.bmHeight,
 			    (int)info->bmiHeader.biWidth, (int)info->bmiHeader.biHeight, startscan );
 
diff --git a/objects/enhmetafile.c b/objects/enhmetafile.c
new file mode 100644
index 0000000..34c1700
--- /dev/null
+++ b/objects/enhmetafile.c
@@ -0,0 +1,225 @@
+/*
+  Enhanced metafile functions
+  Copyright 1998, Douglas Ridgway
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include "windows.h"
+#include "winbase.h"
+#include "winnt.h"
+
+/*****************************************************************************
+ *          GetEnhMetaFile32A (GDI32.174)
+ *
+ *
+ */
+HENHMETAFILE32 GetEnhMetaFile32A( 
+	     LPCSTR lpszMetaFile  /* filename of enhanced metafile */
+    )
+{
+  HENHMETAFILE32 hmf = NULL;
+  ENHMETAHEADER h;
+  char *p;
+  DWORD read;
+  HFILE32 hf = CreateFile32A(lpszMetaFile, GENERIC_READ, 0, 0, 
+			     OPEN_EXISTING, 0, NULL);
+  if (!ReadFile(hf, &h, sizeof(ENHMETAHEADER), &read, NULL)) 
+    return NULL;
+  if (read!=sizeof(ENHMETAHEADER)) return NULL;
+  SetFilePointer(hf, 0, NULL, FILE_BEGIN); 
+  /*  hmf = CreateFileMapping32A( hf, NULL, NULL, NULL, NULL, "temp"); */
+  hmf = GlobalAlloc32(GHND, h.nBytes);
+  p = GlobalLock32(hmf);
+  if (!ReadFile(hf, p, h.nBytes, &read, NULL)) return NULL;
+  GlobalUnlock32(hmf);
+  return hmf;
+}
+
+/*****************************************************************************
+ *        GetEnhMetaFileHeader32  (GDI32.178)
+ *
+ *  If _buf_ is NULL, returns the size of buffer required.
+ *  Otherwise, copy up to _bufsize_ bytes of enhanced metafile header into 
+ *  _buf.
+ */
+UINT32 GetEnhMetaFileHeader32( 
+       HENHMETAFILE32 hmf, /* enhanced metafile */
+       UINT32 bufsize,     /* size of buffer */
+       LPENHMETAHEADER buf /* buffer */ 
+    )
+{
+  LPENHMETAHEADER p = GlobalLock32(hmf);
+  if (!buf) return sizeof(ENHMETAHEADER);
+  memmove(buf, p, MIN(sizeof(ENHMETAHEADER), bufsize));
+  return MIN(sizeof(ENHMETAHEADER), bufsize);
+}
+
+
+/*****************************************************************************
+ *          GetEnhMetaFileDescription32A  (GDI32.176)
+ *
+ *  Copies the description string of an enhanced metafile into a buffer 
+ *  _buf_.
+ *
+ * FIXME
+ *   doesn't work. description is wide, with substructure
+ */
+UINT32 GetEnhMetaFileDescription32A( 
+       HENHMETAFILE32 hmf, /* enhanced metafile */
+       UINT32 size, /* size of buf */ 
+       LPCSTR buf /* buffer to receive description */
+    )
+{
+  LPENHMETAHEADER p = GlobalLock32(hmf);
+  
+  if (!buf || !size) return p->nDescription;
+  lstrcpynWtoA(buf, (void *)p+p->offDescription, size);
+  /*  memmove(buf, (void *)p+p->offDescription, MIN(size,p->nDescription));*/
+  return MIN(size,p->nDescription);
+}
+
+/*****************************************************************************
+ *           PlayEnhMetaFileRecord32  (GDI32.264)
+ *
+ *  Render a single enhanced metafile record in the device context hdc.
+ *
+ *  RETURNS
+ *    TRUE on success, FALSE on error.
+ *  BUGS
+ *    Unimplemented
+ */
+BOOL32 PlayEnhMetaFileRecord32( 
+     HDC32 hdc, 
+     /* device context in which to render EMF record */
+     LPHANDLETABLE32 lpHandletable, 
+     /* array of handles to be used in rendering record */
+     const ENHMETARECORD *lpEnhMetaRecord, /* EMF record to render */
+     UINT32 nHandles  /* size of handle array */
+     ) 
+{
+  int type;
+  fprintf(stdout, 
+  "PlayEnhMetaFileRecord(hdc = %08x, handletable = %p, record = %p, numHandles = %d\n", 
+	  hdc, lpHandletable, lpEnhMetaRecord, nHandles);
+  /*  SetLastError(E_NOTIMPL); */
+  if (!lpEnhMetaRecord) return FALSE;
+
+  type = lpEnhMetaRecord->iType;
+
+  switch(type) 
+    {
+    case EMR_HEADER:
+      printf("Header ok!\n");
+      return TRUE;
+      break;
+    case EMR_EOF:
+      printf("Eof ok!\n");
+      return TRUE;
+      break;
+    }
+  printf("I dunno %d\n", type);
+  return FALSE;
+}
+
+
+/*****************************************************************************
+ *
+ *        EnumEnhMetaFile32  (GDI32.79)
+ *
+ *  Walk an enhanced metafile, calling a user-specified function _EnhMetaFunc_
+ *  for each
+ *  record. Returns when either every record has been used or 
+ *  when _EnhMetaFunc_ returns FALSE.
+ *
+ *
+ * RETURNS
+ *  TRUE if every record is used, FALSE if any invocation of _EnhMetaFunc_
+ *  returns FALSE.
+ *
+ * BUGS
+ *   Doesn't free objects, ignores rect.
+ */
+BOOL32 EnumEnhMetaFile32( 
+     HDC32 hdc, /* device context to pass to _EnhMetaFunc_ */
+     HENHMETAFILE32 hmf, /* EMF to walk */
+     ENHMFENUMPROC32 callback, /* callback function */ 
+     LPVOID data, /* optional data for callback function */
+     const RECT32 *rect  /* bounding rectangle for rendered metafile */
+    )
+{
+  BOOL32 ret = TRUE;
+  LPENHMETARECORD p = GlobalLock32(hmf);
+  INT32 count = ((LPENHMETAHEADER) p)->nHandles;
+  HANDLETABLE32 *ht = (HANDLETABLE32 *)GlobalAlloc32(GPTR, sizeof(HANDLETABLE32)*count);
+  ht->objectHandle[0] = hmf;
+  while (ret) {
+    /*   printf("EnumEnhMetaFile: type = %ld size = %ld\n", p->iType, p->nSize);*/
+    ret = (*callback)(hdc, ht, p, count, data); 
+    if (p->iType == EMR_EOF) break;
+    p = (void *) p + p->nSize;
+  }
+  return ret;
+}
+
+
+/**************************************************************************
+ *    PlayEnhMetaFile32  (GDI32.263)
+ *
+ *    Renders an enhanced metafile into a specified rectangle *lpRect
+ *    in device context hdc.
+ *
+ * BUGS
+ *    Almost entirely unimplemented
+ *
+ */
+BOOL32 PlayEnhMetaFile32( 
+       HDC32 hdc, /* DC to render into */
+       HENHMETAFILE32 hmf, /* metafile to render */
+       const RECT32 *lpRect  /* rectangle to place metafile inside */
+      )
+{
+  LPENHMETARECORD p = GlobalLock32(hmf);
+  INT32 count = ((LPENHMETAHEADER) p)->nHandles;
+  HANDLETABLE32 *ht = (HANDLETABLE32 *)GlobalAlloc32(GPTR, sizeof(HANDLETABLE32)*count);
+  ht->objectHandle[0] = hmf;
+  while (1) {
+    PlayEnhMetaFileRecord32(hdc, ht, p, count);
+    if (p->iType == EMR_EOF) break;
+    p = (void *) p + p->nSize; /* casted so that arithmetic is in bytes */
+  }
+  return FALSE;
+}
+
+/*
+  need wide version as well
+*/
+HDC32 CreateEnhMetaFile32A( 
+    HDC32 hdcRef, /* optional reference DC */
+    LPCSTR lpFilename, /* optional filename for disk metafiles */
+    const RECT32 *lpRect, /* optional bounding rectangle */
+    LPCSTR lpDescription /* optional description */ 
+    )
+{
+  return NULL;
+}
+
+HENHMETAFILE32 CloseEnhMetaFile32( 
+               HDC32 hdc  /* metafile DC */
+	       )
+{
+  return NULL;
+}
+
+
+/*****************************************************************************
+ *  DeleteEnhMetaFile32 (GDI32.68)
+ */
+BOOL32 DeleteEnhMetaFile32(HENHMETAFILE32 hmf) {
+  return FALSE;
+}
+
+/*****************************************************************************
+ *  CopyEnhMetaFileA (GDI32.21)
+ */
+
diff --git a/objects/font.c b/objects/font.c
index 04fe131..afa374d 100644
--- a/objects/font.c
+++ b/objects/font.c
@@ -222,7 +222,7 @@
 	    fontPtr = (FONTOBJ *) GDI_HEAP_LOCK( hFont );
 	    memcpy( &fontPtr->logfont, font, sizeof(LOGFONT16) );
 
-	    dprintf_info(font,"CreateFontIndirect(%i %i) '%s' %s %s => %04x\n",
+	    TRACE(font,"(%i %i) '%s' %s %s => %04x\n",
 				 font->lfHeight, font->lfWidth, 
 				 font->lfFaceName ? font->lfFaceName : "NULL",
 				 font->lfWeight > 400 ? "Bold" : "",
@@ -270,7 +270,7 @@
     LOGFONT16 logfont = { height, width, esc, orient, weight, italic, underline,
                           strikeout, charset, outpres, clippres, quality, pitch, };
 
-    dprintf_info(font,"CreateFont16('%s',%d,%d)\n",
+    TRACE(font,"('%s',%d,%d)\n",
 		 (name ? name : "(null)") , height, width);
     if (name) 
 	lstrcpyn32A(logfont.lfFaceName,name,sizeof(logfont.lfFaceName));
@@ -715,7 +715,7 @@
         !dc->funcs->pGetTextExtentPoint( dc, str, count, size ))
         return FALSE;
 
-    dprintf_info(font,"GetTextExtentPoint(%08x %s %d %p): returning %d,%d\n",
+    TRACE(font,"(%08x %s %d %p): returning %d,%d\n",
                  hdc, debugstr_an (str, count), count,
 		 size, size->cx, size->cy );
     return TRUE;
@@ -741,7 +741,7 @@
 BOOL32 WINAPI GetTextExtentPoint32ABuggy( HDC32 hdc, LPCSTR str, INT32 count,
                                           LPSIZE32 size )
 {
-    dprintf_info(font, "GetTextExtentPoint32ABuggy: not bug compatible.\n");
+    TRACE(font, "not bug compatible.\n");
     return GetTextExtentPoint32A( hdc, str, count, size );
 }
 
@@ -751,7 +751,7 @@
 BOOL32 WINAPI GetTextExtentPoint32WBuggy( HDC32 hdc, LPCWSTR str, INT32 count,
                                           LPSIZE32 size )
 {
-    dprintf_info(font, "GetTextExtentPoint32WBuggy: not bug compatible.\n");
+    TRACE(font, "not bug compatible.\n");
     return GetTextExtentPoint32W( hdc, str, count, size );
 }
 
@@ -791,7 +791,7 @@
     size->cx = extent;
    *lpnFit = nFit;
 
-    dprintf_info(font,"GetTextExtentExPoint32A(%08x '%.*s' %d) returning %d %d %d\n",
+    TRACE(font,"(%08x '%.*s' %d) returning %d %d %d\n",
                hdc,count,str,maxExt,nFit, size->cx,size->cy);
     return TRUE;
 }
@@ -860,7 +860,7 @@
     metrics->tmMaxCharWidth     = WDPTOLP(metrics->tmMaxCharWidth);
     metrics->tmOverhang         = WDPTOLP(metrics->tmOverhang);
 
-    dprintf_info(font,"text metrics:
+    TRACE(font,"text metrics:
     Weight = %03i\t FirstChar = %03i\t AveCharWidth = %i
     Italic = % 3i\t LastChar = %03i\t\t MaxCharWidth = %i
     UnderLined = %01i\t DefaultChar = %03i\t Overhang = %i
@@ -987,7 +987,7 @@
  */
 DWORD WINAPI SetMapperFlags32( HDC32 hDC, DWORD dwFlag )
 {
-    dprintf_fixme(font, "SetMapperFlags(%04x, %08lX) // Empty Stub !\n",
+    FIXME(font, "(%04x, %08lX) -- Empty Stub !\n",
 		  hDC, dwFlag);
     return 0L;
 }
@@ -997,7 +997,7 @@
  */
 BOOL16 GetAspectRatioFilterEx16( HDC16 hdc, LPVOID pAspectRatio )
 {
-  dprintf_fixme(font, "GetAspectRatioFilterEx(%04x, %p): // Empty Stub !\n",
+  FIXME(font, "(%04x, %p): -- Empty Stub !\n",
 		hdc, pAspectRatio);
   return FALSE;
 }
diff --git a/objects/gdiobj.c b/objects/gdiobj.c
index d19aad3..283dcd1 100644
--- a/objects/gdiobj.c
+++ b/objects/gdiobj.c
@@ -360,7 +360,7 @@
         return TRUE;
     if (!(header = (GDIOBJHDR *) GDI_HEAP_LOCK( obj ))) return FALSE;
 
-    dprintf_info(gdi, "DeleteObject: %04x\n", obj );
+    TRACE(gdi, "%04x\n", obj );
 
       /* Delete object */
 
@@ -393,7 +393,7 @@
 {
     if ((obj < 0) || (obj >= NB_STOCK_OBJECTS)) return 0;
     if (!StockObjects[obj]) return 0;
-    dprintf_info(gdi, "GetStockObject: returning %d\n",
+    TRACE(gdi, "returning %d\n",
                 FIRST_STOCK_HANDLE + obj );
     return (HGDIOBJ16)(FIRST_STOCK_HANDLE + obj);
 }
@@ -406,7 +406,7 @@
 {
     GDIOBJHDR * ptr = NULL;
     INT16 result = 0;
-    dprintf_info(gdi, "GetObject16: %04x %d %p\n", handle, count, buffer );
+    TRACE(gdi, "%04x %d %p\n", handle, count, buffer );
     if (!count) return 0;
 
     if ((handle >= FIRST_STOCK_HANDLE) && (handle <= LAST_STOCK_HANDLE))
@@ -445,7 +445,7 @@
 {
     GDIOBJHDR * ptr = NULL;
     INT32 result = 0;
-    dprintf_info(gdi, "GetObject32A: %08x %d %p\n", handle, count, buffer );
+    TRACE(gdi, "%08x %d %p\n", handle, count, buffer );
     if (!count) return 0;
 
     if ((handle >= FIRST_STOCK_HANDLE) && (handle <= LAST_STOCK_HANDLE))
@@ -469,6 +469,9 @@
 	  result = FONT_GetObject32A( (FONTOBJ *)ptr, count, buffer );
 	  break;
       case PALETTE_MAGIC:
+	  result = PALETTE_GetObject( (PALETTEOBJ *)ptr, count, buffer );
+	  break;
+      default:
           fprintf( stderr, "GetObject32: magic %04x not implemented\n",
                    ptr->wMagic );
           break;
@@ -484,7 +487,7 @@
 {
     GDIOBJHDR * ptr = NULL;
     INT32 result = 0;
-    dprintf_info(gdi, "GetObjectType: %08x\n", handle );
+    TRACE(gdi, "%08x\n", handle );
 
     if ((handle >= FIRST_STOCK_HANDLE) && (handle <= LAST_STOCK_HANDLE))
       ptr = StockObjects[handle - FIRST_STOCK_HANDLE];
@@ -581,7 +584,7 @@
 {
     DC * dc = DC_GetDCPtr( hdc );
     if (!dc || !dc->funcs->pSelectObject) return 0;
-    dprintf_info(gdi, "SelectObject: hdc=%04x %04x\n", hdc, handle );
+    TRACE(gdi, "hdc=%04x %04x\n", hdc, handle );
     return dc->funcs->pSelectObject( dc, handle );
 }
 
@@ -606,7 +609,7 @@
     GDIOBJHDR * header = (GDIOBJHDR *) GDI_HEAP_LOCK( obj );
     if (!header) return FALSE;
 
-    dprintf_info(gdi, "UnrealizeObject: %04x\n", obj );
+    TRACE(gdi, "%04x\n", obj );
 
       /* Unrealize object */
 
@@ -647,7 +650,7 @@
     LOGPEN16 *pen;
     LOGBRUSH16 *brush = NULL;
 
-    dprintf_info(gdi, "EnumObjects16: %04x %d %08lx %08lx\n",
+    TRACE(gdi, "%04x %d %08lx %08lx\n",
                  hdc, nObjType, (DWORD)lpEnumFunc, lParam );
     switch(nObjType)
     {
@@ -661,7 +664,7 @@
             pen->lopnWidth.y = 0;
             pen->lopnColor   = solid_colors[i];
             retval = lpEnumFunc( SEGPTR_GET(pen), lParam );
-            dprintf_info(gdi, "EnumObjects16: solid pen %08lx, ret=%d\n",
+            TRACE(gdi, "solid pen %08lx, ret=%d\n",
                          solid_colors[i], retval);
             if (!retval) break;
         }
@@ -677,7 +680,7 @@
             brush->lbColor = solid_colors[i];
             brush->lbHatch = 0;
             retval = lpEnumFunc( SEGPTR_GET(brush), lParam );
-            dprintf_info(gdi, "EnumObjects16: solid brush %08lx, ret=%d\n",
+            TRACE(gdi, "solid brush %08lx, ret=%d\n",
                          solid_colors[i], retval);
             if (!retval) break;
         }
@@ -689,7 +692,7 @@
             brush->lbColor = RGB(0,0,0);
             brush->lbHatch = i;
             retval = lpEnumFunc( SEGPTR_GET(brush), lParam );
-            dprintf_info(gdi, "EnumObjects16: hatched brush %d, ret=%d\n",
+            TRACE(gdi, "hatched brush %d, ret=%d\n",
                          i, retval);
             if (!retval) break;
         }
@@ -726,7 +729,7 @@
     LOGPEN32 pen;
     LOGBRUSH32 brush;
 
-    dprintf_info(gdi, "EnumObjects32: %04x %d %08lx %08lx\n",
+    TRACE(gdi, "%04x %d %08lx %08lx\n",
                  hdc, nObjType, (DWORD)lpEnumFunc, lParam );
     switch(nObjType)
     {
@@ -739,7 +742,7 @@
             pen.lopnWidth.y = 0;
             pen.lopnColor   = solid_colors[i];
             retval = lpEnumFunc( &pen, lParam );
-            dprintf_info(gdi, "EnumObjects32: solid pen %08lx, ret=%d\n",
+            TRACE(gdi, "solid pen %08lx, ret=%d\n",
                          solid_colors[i], retval);
             if (!retval) break;
         }
@@ -753,7 +756,7 @@
             brush.lbColor = solid_colors[i];
             brush.lbHatch = 0;
             retval = lpEnumFunc( &brush, lParam );
-            dprintf_info(gdi, "EnumObjects32: solid brush %08lx, ret=%d\n",
+            TRACE(gdi, "solid brush %08lx, ret=%d\n",
                          solid_colors[i], retval);
             if (!retval) break;
         }
@@ -765,7 +768,7 @@
             brush.lbColor = RGB(0,0,0);
             brush.lbHatch = i;
             retval = lpEnumFunc( &brush, lParam );
-            dprintf_info(gdi, "EnumObjects32: hatched brush %d, ret=%d\n",
+            TRACE(gdi, "hatched brush %d, ret=%d\n",
                          i, retval);
             if (!retval) break;
         }
@@ -885,17 +888,23 @@
 
 /***********************************************************************
  *           MulDiv32   (KERNEL32.391)
+ * RETURNS
+ *	Result of multiplication and division
+ *	-1: Overflow occurred or Divisor was 0
  */
-INT32 WINAPI MulDiv32( INT32 foo, INT32 bar, INT32 baz )
-{
+INT32 WINAPI MulDiv32(
+	     INT32 nMultiplicand, 
+	     INT32 nMultiplier,
+	     INT32 nDivisor
+) {
 #ifdef __GNUC__
     long long ret;
-    if (!baz) return -1;
-    ret = ((long long)foo * bar) / baz;
+    if (!nDivisor) return -1;
+    ret = ((long long)nMultiplicand * nMultiplier) / nDivisor;
     if ((ret > 2147483647) || (ret < -2147483647)) return -1;
     return ret;
 #else
-    if (!baz) return -1;
-    return (foo * bar) / baz;
+    if (!nDivisor) return -1;
+    return (nMultiplicand * nMultiplier) / nDivisor;
 #endif
 }
diff --git a/objects/metafile.c b/objects/metafile.c
index 1d58af0..686d5cd 100644
--- a/objects/metafile.c
+++ b/objects/metafile.c
@@ -79,7 +79,7 @@
   HFILE32 hFile;
   DWORD size;
   
-  dprintf_info(metafile,"GetMetaFile: %s\n", lpFilename);
+  TRACE(metafile,"%s\n", lpFilename);
 
   if (!lpFilename)
     return 0;
@@ -178,18 +178,15 @@
  *  Copying to disk returns NULL even if successful.
  */
 HMETAFILE32 WINAPI CopyMetaFile32A(
-				   HMETAFILE32 hSrcMetaFile, 
-				   /* handle of metafile to copy */
-				   LPCSTR lpFilename
-				   /* filename if copying to a file */
-)
-{
+		   HMETAFILE32 hSrcMetaFile, /* handle of metafile to copy */
+		   LPCSTR lpFilename /* filename if copying to a file */
+) {
     HMETAFILE16 handle = 0;
     METAHEADER *mh;
     METAHEADER *mh2;
     HFILE32 hFile;
     
-    dprintf_info(metafile,"CopyMetaFile: %s\n", lpFilename);
+    TRACE(metafile,"%s\n", lpFilename);
     
     mh = (METAHEADER *)GlobalLock16(hSrcMetaFile);
     
@@ -260,7 +257,7 @@
             resu=TRUE;
       GlobalUnlock16(hmf);
     }
-    dprintf_info(metafile,"IsValidMetaFile %x => %d\n",hmf,resu);
+    TRACE(metafile,"IsValidMetaFile %x => %d\n",hmf,resu);
     return resu;         
 }
 
@@ -296,7 +293,7 @@
     HFONT32 hFont;
     DC *dc;
     
-    dprintf_info(metafile,"PlayMetaFile(%04x %04x)\n",hdc,hmf);
+    TRACE(metafile,"(%04x %04x)\n",hdc,hmf);
     if (!mh) return FALSE;
     if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0;
     hPen = dc->w.hPen;
@@ -314,7 +311,7 @@
     while (offset < mh->mtSize * 2)
     {
         mr = (METARECORD *)((char *)mh + offset);
-	dprintf_info(metafile,"offset = %04x size = %08lx\n",
+	TRACE(metafile,"offset = %04x size = %08lx\n",
 			 offset, mr->rdSize);
 	if (!mr->rdSize) {
 		fprintf(stderr,"METAFILE entry got size 0 at offset %d, total mf length is %ld\n",offset,mh->mtSize*2);
@@ -374,7 +371,7 @@
     DC *dc;
     BOOL16 result = TRUE;
     
-    dprintf_info(metafile,"EnumMetaFile(%04x, %04x, %08lx, %08lx)\n",
+    TRACE(metafile,"(%04x, %04x, %08lx, %08lx)\n",
 		     hdc, hmf, (DWORD)lpEnumFunc, lpData);
 
     if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0;
@@ -443,26 +440,19 @@
  *  ABORTDOC, ENDDOC, CREATEBRUSH, CREATEBITMAPINDIRECT, and CREATEBITMAP.
  *
  */
-
 void WINAPI PlayMetaFileRecord16( 
-				 HDC16 hdc, 
-				 /* DC to render metafile into */
-				 HANDLETABLE16 *ht, 
-				 /* pointer to handle table for metafile objects */
-				 METARECORD *mr, 
-				 /* pointer to metafile record to render */
-				 UINT16 nHandles 
-				 /* size of handle table */
-)
-{
+	    HDC16 hdc, /* DC to render metafile into */
+	    HANDLETABLE16 *ht, /* pointer to handle table for metafile objects */
+	    METARECORD *mr, /* pointer to metafile record to render */
+	    UINT16 nHandles /* size of handle table */
+) {
     short s1;
     HANDLE16 hndl;
     char *ptr;
     BITMAPINFOHEADER *infohdr;
 
-    dprintf_info(metafile,
-"PlayMetaFileRecord(%04x %08lx %08lx %04x) function %04x\n",
-		     hdc,(LONG)ht, (LONG)mr, nHandles, mr->rdFunction);
+    TRACE(metafile,"(%04x %08lx %08lx %04x) function %04x\n",
+		 hdc,(LONG)ht, (LONG)mr, nHandles, mr->rdFunction);
     
     switch (mr->rdFunction)
     {
@@ -711,7 +701,7 @@
 	break;
 
     case META_ESCAPE:
-	dprintf_fixme(metafile, "PlayMetaFileRecord: META_ESCAPE unimplemented.\n");
+	FIXME(metafile, "META_ESCAPE unimplemented.\n");
         break;
 
         /* --- Begin of fixed or new metafile operations. July 1996 ----*/
@@ -736,7 +726,7 @@
             dxx = (LPINT16)(sot+(((s1+1)>>1)*2));	   
           else 
 	  {
-	   dprintf_info(metafile,"EXTTEXTOUT: %s  len: %ld\n",
+	   TRACE(metafile,"%s  len: %ld\n",
              sot,mr->rdSize);
            fprintf(stderr,
 	     "Please report: PlayMetaFile/ExtTextOut len=%ld slen=%d rdSize=%ld opt=%04x\n",
@@ -750,7 +740,7 @@
 		           sot,				/* string */
                            s1, dxx);                    /* length, dx array */
         if (dxx)                      
-          dprintf_info(metafile,"EXTTEXTOUT: %s  len: %ld  dx0: %d\n",
+          TRACE(metafile,"%s  len: %ld  dx0: %d\n",
             sot,mr->rdSize,dxx[0]);
        }
        break;
@@ -841,7 +831,7 @@
 
      case META_DIBCREATEPATTERNBRUSH:
 	/*  *(mr->rdParam) may be BS_PATTERN or BS_DIBPATTERN: but there's no difference */
-        dprintf_info(metafile,"META_DIBCREATEPATTERNBRUSH: %d\n",*(mr->rdParam));
+        TRACE(metafile,"%d\n",*(mr->rdParam));
 	s1 = mr->rdSize * 2 - sizeof(METARECORD) - 2;
 	hndl = GlobalAlloc16(GMEM_MOVEABLE, s1);
 	ptr = GlobalLock16(hndl);
@@ -907,7 +897,7 @@
 				 HMETAFILE16 hmf /* metafile handle */
 				 )
 {
-    dprintf_info(metafile,"GetMetaFileBits: hMem out: %04x\n", hmf);
+    TRACE(metafile,"hMem out: %04x\n", hmf);
     return hmf;
 }
 
@@ -924,7 +914,7 @@
 			/* handle to a memory region holding a metafile */
 )
 {
-    dprintf_info(metafile,"SetMetaFileBits: hmf out: %04x\n", hMem);
+    TRACE(metafile,"hmf out: %04x\n", hMem);
 
     return hMem;
 }
@@ -1042,7 +1032,7 @@
 	memcpy((WORD *)physDev->mh + physDev->mh->mtSize, mr, rlen);
         break;
     case METAFILE_DISK:
-        dprintf_info(metafile,"Writing record to disk\n");
+        TRACE(metafile,"Writing record to disk\n");
 	if (_lwrite32(physDev->mh->mtNoParameters, (char *)mr, rlen) == -1)
 	    return FALSE;
         break;
@@ -1442,7 +1432,7 @@
     *(mr->rdParam + 9) = BM.bmWidthBytes;
     *(mr->rdParam +10) = BM.bmPlanes;
     *(mr->rdParam +11) = BM.bmBitsPixel;
-    dprintf_info(metafile,"MF_StretchBlt->len = %ld  rop=%lx  \n",len,rop);
+    TRACE(metafile,"MF_StretchBlt->len = %ld  rop=%lx  \n",len,rop);
     if (GetBitmapBits32(dcSrc->w.hBitmap,BM.bmWidthBytes * BM.bmHeight,
                         mr->rdParam +12))
     {
@@ -1507,7 +1497,7 @@
     lpBMI->biYPelsPerMeter = MulDiv32(GetDeviceCaps(dcSrc->hSelf,LOGPIXELSY),3937,100);
     lpBMI->biClrImportant  = 0;                          /* 1 meter  = 39.37 inch */
 
-    dprintf_info(metafile,"MF_StretchBltViaDIB->len = %ld  rop=%lx  PixYPM=%ld Caps=%d\n",
+    TRACE(metafile,"MF_StretchBltViaDIB->len = %ld  rop=%lx  PixYPM=%ld Caps=%d\n",
                len,rop,lpBMI->biYPelsPerMeter,GetDeviceCaps(hdcSrc,LOGPIXELSY));
     if (GetDIBits(hdcSrc,dcSrc->w.hBitmap,0,(UINT32)lpBMI->biHeight,
                   (LPSTR)lpBMI + DIB_BitmapInfoSize( (BITMAPINFO *)lpBMI,
@@ -1524,7 +1514,7 @@
     *(mr->rdParam +12) = BM.bmWidthBytes;
     *(mr->rdParam +13) = BM.bmPlanes;
     *(mr->rdParam +14) = BM.bmBitsPixel;
-    dprintf_info(metafile,"MF_StretchBlt->len = %ld  rop=%lx  \n",len,rop);
+    TRACE(metafile,"MF_StretchBlt->len = %ld  rop=%lx  \n",len,rop);
     if (GetBitmapBits32( dcSrc->w.hBitmap, BM.bmWidthBytes * BM.bmHeight,
                          mr->rdParam +15))
 #endif    
diff --git a/objects/palette.c b/objects/palette.c
index d11c2cd..8e25970 100644
--- a/objects/palette.c
+++ b/objects/palette.c
@@ -93,7 +93,7 @@
     HPALETTE32 hpalette;
     int size = sizeof(LOGPALETTE) + (palette->palNumEntries - 1) * sizeof(PALETTEENTRY);
 
-    dprintf_info(palette,"CreatePalette: %i entries \n",
+    TRACE(palette,"%i entries \n",
                     palette->palNumEntries);
 
     hpalette = GDI_AllocObject( size + sizeof(int*) +sizeof(GDIOBJHDR) , PALETTE_MAGIC );
@@ -106,7 +106,7 @@
     palettePtr->mapping = NULL;
     GDI_HEAP_UNLOCK( hpalette );
 
-    dprintf_info(palette,"   returning %04x\n", hpalette);
+    TRACE(palette,"   returning %04x\n", hpalette);
     return hpalette;
 }
 
@@ -138,7 +138,7 @@
     PALETTEOBJ * palPtr;
     INT32 numEntries;
 
-    dprintf_info(palette,"GetPaletteEntries: hpal = %04x, %i entries\n",
+    TRACE(palette,"hpal = %04x, %i entries\n",
                      hpalette, count );
         
     palPtr = (PALETTEOBJ *) GDI_GetObjPtr( hpalette, PALETTE_MAGIC );
@@ -180,7 +180,7 @@
     PALETTEOBJ * palPtr;
     INT32 numEntries;
 
-    dprintf_info(palette,"SetPaletteEntries: hpal = %04x, %i entries\n",
+    TRACE(palette,"hpal = %04x, %i entries\n",
                      hpalette, count );
 
     palPtr = (PALETTEOBJ *) GDI_GetObjPtr( hpalette, PALETTE_MAGIC );
@@ -223,7 +223,7 @@
     int		 prevsize, size = sizeof(LOGPALETTE) + (cEntries - 1) * sizeof(PALETTEENTRY);
     int*	 mapping = NULL;
 
-    dprintf_info(palette,"ResizePalette: hpal = %04x, prev = %i, new = %i\n",
+    TRACE(palette,"hpal = %04x, prev = %i, new = %i\n",
 		    hPal, palPtr ? palPtr->logpalette.palNumEntries : -1,
                     cEntries );
     if( !palPtr ) return FALSE;
@@ -275,7 +275,7 @@
 BOOL32 WINAPI AnimatePalette32( HPALETTE32 hPal, UINT32 StartIndex,
                                UINT32 NumEntries, LPPALETTEENTRY PaletteColors)
 {
-    dprintf_info(palette, "AnimatePalette: %04x (%i - %i)\n", hPal, 
+    TRACE(palette, "%04x (%i - %i)\n", hPal, 
                     StartIndex, StartIndex + NumEntries );
 
     if( hPal != STOCK_DEFAULT_PALETTE ) 
@@ -356,7 +356,7 @@
     UINT32 i;
     DC *dc;
 
-    dprintf_info(palette, "GetSystemPaletteEntries: hdc = %04x, "
+    TRACE(palette, "hdc = %04x, "
 		    "cound = %i\n", hdc, count );
 
     if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0;
@@ -371,7 +371,7 @@
     {
 	*(COLORREF*)(entries + i) = COLOR_GetSystemPaletteEntry( start + i );
 
-        dprintf_info(palette,"\tidx(%02x) -> RGB(%08lx)\n",
+        TRACE(palette,"\tidx(%02x) -> RGB(%08lx)\n",
                          start + i, *(COLORREF*)(entries + i) );
     }
     GDI_HEAP_UNLOCK( hdc );
@@ -401,7 +401,7 @@
 				          palObj->logpalette.palNumEntries,
                                           NULL, color, FALSE );
 
-    dprintf_info(palette,"GetNearestPaletteIndex(%04x,%06lx): returning %d\n", 
+    TRACE(palette,"(%04x,%06lx): returning %d\n", 
                     hpalette, color, index );
     GDI_HEAP_UNLOCK( hpalette );
     return index;
@@ -437,7 +437,7 @@
       GDI_HEAP_UNLOCK( dc->w.hPalette );
     }
 
-    dprintf_info(palette,"GetNearestColor(%06lx): returning %06lx\n", 
+    TRACE(palette,"(%06lx): returning %06lx\n", 
                     color, nearest );
     GDI_HEAP_UNLOCK( hdc );    
     return nearest;
@@ -489,7 +489,7 @@
     HPALETTE16 prev;
     DC *dc;
 
-    dprintf_info(palette, "GDISelectPalette: %04x %04x\n", hdc, hpal );
+    TRACE(palette, "%04x %04x\n", hdc, hpal );
     
     dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
     if (!dc) 
@@ -519,7 +519,7 @@
 	if (!dc) return 0;
     }
 
-    dprintf_info(palette, "GDIRealizePalette: %04x...\n", hdc );
+    TRACE(palette, "%04x...\n", hdc );
     
     if( dc &&  dc->w.hPalette != hLastRealizedPalette )
     {
@@ -534,11 +534,11 @@
 	GDI_HEAP_UNLOCK( dc->w.hPalette );
 	hLastRealizedPalette = dc->w.hPalette;
     }
-    else dprintf_info(palette, "  skipping (hLastRealizedPalette = %04x)\n",
+    else TRACE(palette, "  skipping (hLastRealizedPalette = %04x)\n",
 			 hLastRealizedPalette);
     
     GDI_HEAP_UNLOCK( hdc );
-    dprintf_fixme(palette, "   realized %i colors - not impmenented?\n", realized );
+    FIXME(palette, "   realized %i colors - not impmenented?\n", realized );
     return (UINT16)realized;
 }
 
@@ -552,7 +552,7 @@
     PALETTEOBJ*  palPtr;
     int          i, index, realized = 0;
 
-    dprintf_info(palette,"RealizeDefaultPalette: %04x\n", hdc );
+    TRACE(palette,"%04x\n", hdc );
 
     dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
     if (!dc) 
@@ -619,11 +619,11 @@
     WORD	wBkgPalette = 1;
     PALETTEOBJ* lpt = (PALETTEOBJ*) GDI_GetObjPtr( hPal, PALETTE_MAGIC );
 
-    dprintf_info(palette,"SelectPalette: dc %04x pal %04x, force=%i \n", 
+    TRACE(palette,"dc %04x pal %04x, force=%i \n", 
 			    hDC, hPal, bForceBackground);
     if( !lpt ) return 0;
 
-    dprintf_info(palette," entries = %d\n", 
+    TRACE(palette," entries = %d\n", 
 			    lpt->logpalette.palNumEntries);
     GDI_HEAP_UNLOCK( hPal );
 
diff --git a/objects/pen.c b/objects/pen.c
index e1f44a9..79ca82c 100644
--- a/objects/pen.c
+++ b/objects/pen.c
@@ -17,7 +17,7 @@
 HPEN16 WINAPI CreatePen16( INT16 style, INT16 width, COLORREF color )
 {
     LOGPEN32 logpen = { style, { width, 0 }, color };
-    dprintf_info(gdi, "CreatePen16: %d %d %06lx\n", style, width, color );
+    TRACE(gdi, "%d %d %06lx\n", style, width, color );
     return CreatePenIndirect32( &logpen );
 }
 
@@ -28,7 +28,7 @@
 HPEN32 WINAPI CreatePen32( INT32 style, INT32 width, COLORREF color )
 {
     LOGPEN32 logpen = { style, { width, 0 }, color };
-    dprintf_info(gdi, "CreatePen32: %d %d %06lx\n", style, width, color );
+    TRACE(gdi, "%d %d %06lx\n", style, width, color );
     return CreatePenIndirect32( &logpen );
 }
 
diff --git a/objects/region.c b/objects/region.c
index ef798dd..8572d56 100644
--- a/objects/region.c
+++ b/objects/region.c
@@ -106,11 +106,11 @@
 {
     RECT32 *pRect, *pRectEnd = pReg->rects + pReg->numRects;
 
-    dprintf_info(region, "Region %p: %d,%d - %d,%d %d rects\n", pReg,
+    TRACE(region, "Region %p: %d,%d - %d,%d %d rects\n", pReg,
 	    pReg->extents.left, pReg->extents.top,
 	    pReg->extents.right, pReg->extents.bottom, pReg->numRects);
     for(pRect = pReg->rects; pRect < pRectEnd; pRect++)
-        dprintf_info(region, "\t%d,%d - %d,%d\n", pRect->left, pRect->top,
+        TRACE(region, "\t%d,%d - %d,%d\n", pRect->left, pRect->top,
 		       pRect->right, pRect->bottom);
     return;
 }
@@ -170,7 +170,7 @@
  */
 BOOL32 REGION_DeleteObject( HRGN32 hrgn, RGNOBJ * obj )
 {
-    dprintf_info(region, "DeleteRegion: %04x\n", hrgn );
+    TRACE(region, " %04x\n", hrgn );
 
     REGION_DestroyWineRegion( obj->rgn );
     return GDI_FreeObject( hrgn );
@@ -197,7 +197,7 @@
 	int nbox = obj->rgn->numRects;
 	RECT32 *pbox = obj->rgn->rects;
 	
-	dprintf_info(region, "OffsetRgn: %04x %d,%d\n", hrgn, x, y );
+	TRACE(region, " %04x %d,%d\n", hrgn, x, y );
 	if(nbox && (x || y)) {
 	    while(nbox--) {
 	        pbox->left += x;
@@ -239,7 +239,7 @@
     if (obj)
     {
 	INT32 ret;
-	dprintf_info(region, "GetRgnBox: %04x\n", hrgn );
+	TRACE(region, " %04x\n", hrgn );
 	rect->left = obj->rgn->extents.left;
 	rect->top = obj->rgn->extents.top;
 	rect->right = obj->rgn->extents.right;
@@ -270,7 +270,7 @@
 
     if (!(hrgn = REGION_CreateRegion()))
 	return 0;
-    dprintf_info(region, "CreateRectRgn: \n");
+    TRACE(region, " \n");
     SetRectRgn32(hrgn, left, top, right, bottom);
     return hrgn;
 }
@@ -311,7 +311,7 @@
 {
     RGNOBJ * obj;
 
-    dprintf_info(region, "SetRectRgn: %04x %d,%d-%d,%d\n", 
+    TRACE(region, " %04x %d,%d-%d,%d\n", 
 		   hrgn, left, top, right, bottom );
     
     if (!(obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ))) return;
@@ -364,7 +364,7 @@
 
     if (!(hrgn = REGION_CreateRegion())) return 0;
     obj = (RGNOBJ *) GDI_HEAP_LOCK( hrgn );
-    dprintf_info(region,"CreateRoundRectRgn(%d,%d-%d,%d %dx%d): ret=%04x\n",
+    TRACE(region,"(%d,%d-%d,%d %dx%d): ret=%04x\n",
 	       left, top, right, bottom, ellipse_width, ellipse_height, hrgn );
 
       /* Check parameters */
@@ -495,7 +495,7 @@
     DWORD size;
     RGNOBJ *obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC );
     
-    dprintf_info(region, "GetRegionData: %04x count = %ld, rgndata = %p\n",
+    TRACE(region, " %04x count = %ld, rgndata = %p\n",
 		   hrgn, count, rgndata);
 
     if(!obj) return 0;
@@ -532,7 +532,7 @@
     RGNOBJ *obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC );
     RECT32 *pCurRect, *pEndRect;
 
-    dprintf_info(region, "ExtCreateRegion: %p %ld %p. Returning %04x\n",
+    TRACE(region, " %p %ld %p. Returning %04x\n",
 		   lpXform, dwCount, rgndata, hrgn);
     if(!hrgn)
     {
@@ -773,7 +773,7 @@
     DC * dc = DC_GetDCPtr( hdc );
     RECT32 tmpRect;
 
-    dprintf_info(region, "REGION_LPTODP: hdc=%04x dest=%04x src=%04x\n",
+    TRACE(region, " hdc=%04x dest=%04x src=%04x\n",
 		    hdc, hDest, hSrc) ;
     
     if (dc->w.MapMode == MM_TEXT) /* Requires only a translation */
@@ -828,16 +828,16 @@
     RGNOBJ *destObj = (RGNOBJ *) GDI_GetObjPtr( hDest, REGION_MAGIC);
     INT32 result = ERROR;
 
-    dprintf_info(region, "CombineRgn: %04x,%04x -> %04x mode=%x\n", 
-		   hSrc1, hSrc2, hDest, mode );
+    TRACE(region, " %04x,%04x -> %04x mode=%x\n", 
+		 hSrc1, hSrc2, hDest, mode );
     if (destObj)
     {
 	RGNOBJ *src1Obj = (RGNOBJ *) GDI_GetObjPtr( hSrc1, REGION_MAGIC);
 
 	if (src1Obj)
 	{
-	    dprintf_info(region, "src1:\n");
-	    if(debugging_info(region)) 
+	    TRACE(region, "dump:\n");
+	    if(TRACE_ON(region)) 
 	      REGION_DumpRegion(src1Obj->rgn);
 	    if (mode == RGN_COPY)
 	    {
@@ -850,8 +850,8 @@
 
 		if (src2Obj)
 		{
-		    dprintf_info(region, "src2:\n");
-		    if(debugging_info(region)) 
+		    TRACE(region, "dump:\n");
+		    if(TRACE_ON(region)) 
 		      REGION_DumpRegion(src2Obj->rgn);
 		    switch (mode)
 		    {
@@ -874,8 +874,8 @@
 	    }
 	    GDI_HEAP_UNLOCK( hSrc1 );
 	}
-	dprintf_info(region, "dest:\n");
-	if(debugging_info(region)) 
+	TRACE(region, "dump:\n");
+	if(TRACE_ON(region)) 
 	  REGION_DumpRegion(destObj->rgn);
 
 	GDI_HEAP_UNLOCK( hDest );
@@ -969,12 +969,11 @@
  *          - pReg->numRects will be decreased.
  *
  */
-static INT32 REGION_Coalesce (WINEREGION *pReg, INT32 prevStart,
-			      INT32 curStart)
-   /*   pReg - Region to coalesce */
-   /*   prevStart - Index of start of previous band */
-   /*   curStart - Index of start of current band */
-{
+static INT32 REGION_Coalesce (
+	     WINEREGION *pReg, /* Region to coalesce */
+	     INT32 prevStart,  /* Index of start of previous band */
+	     INT32 curStart    /* Index of start of current band */
+) {
     RECT32 *pPrevRect;          /* Current rect in previous band */
     RECT32 *pCurRect;           /* Current rect in current band */
     RECT32 *pRegEnd;            /* End of region */
@@ -1116,19 +1115,14 @@
  *      to reduce the number of rectangles in the region.
  *
  */
-static void REGION_RegionOp(WINEREGION *newReg, WINEREGION *reg1,
-	WINEREGION *reg2, void (*overlapFunc)(), void (*nonOverlap1Func)(),
-	void (*nonOverlap2Func)())
-
-	/* newReg - Place to store result */
-	/* reg1 -   First region in operation */
-	/* reg2 -   2nd region in operation */
-	/* overlapFunc -  Function to call for over-lapping bands */
-	/* nonOverlap1Func - Function to call for non-overlapping bands in
-					region 1 */
-	/* nonOverlap2Func - Function to call for non-overlapping bands in
-					region 2 */
-{
+static void REGION_RegionOp(
+	    WINEREGION *newReg, /* Place to store result */
+	    WINEREGION *reg1,   /* First region in operation */
+            WINEREGION *reg2,   /* 2nd region in operation */
+	    void (*overlapFunc)(),     /* Function to call for over-lapping bands */
+	    void (*nonOverlap1Func)(), /* Function to call for non-overlapping bands in region 1 */
+	    void (*nonOverlap2Func)()  /* Function to call for non-overlapping bands in region 2 */
+) {
     RECT32 *r1;                         /* Pointer into first region */
     RECT32 *r2;                         /* Pointer into 2d region */
     RECT32 *r1End;                      /* End of 1st region */
diff --git a/objects/text.c b/objects/text.c
index 87cab6d..4f83209 100644
--- a/objects/text.c
+++ b/objects/text.c
@@ -198,7 +198,7 @@
     int width = rect->right - rect->left;
     int max_width = 0;
 
-    dprintf_info(text,"DrawText: '%s', %d , [(%d,%d),(%d,%d)]\n", str,
+    TRACE(text,"'%s', %d , [(%d,%d),(%d,%d)]\n", str,
 		 count, rect->left, rect->top, rect->right, rect->bottom);
     
     if (count == -1) count = strlen(str);
@@ -636,7 +636,7 @@
                              INT16 count, INT16 cTabStops,
                              const INT16 *lpTabPos, INT16 nTabOrg )
 {
-    dprintf_info(text, "TabbedTextOut16: %04x %d,%d '%.*s' %d\n",
+    TRACE(text, "%04x %d,%d '%.*s' %d\n",
                   hdc, x, y, count, lpstr, count );
     return TEXT_TabbedTextOut( hdc, x, y, lpstr, count, cTabStops,
                                lpTabPos, NULL, nTabOrg, TRUE );
@@ -650,7 +650,7 @@
                               INT32 count, INT32 cTabStops,
                               const INT32 *lpTabPos, INT32 nTabOrg )
 {
-    dprintf_info(text, "TabbedTextOut32A: %04x %d,%d '%.*s' %d\n",
+    TRACE(text, "%04x %d,%d '%.*s' %d\n",
                   hdc, x, y, count, lpstr, count );
     return TEXT_TabbedTextOut( hdc, x, y, lpstr, count, cTabStops,
                                NULL, lpTabPos, nTabOrg, TRUE );
@@ -680,7 +680,7 @@
 DWORD WINAPI GetTabbedTextExtent16( HDC16 hdc, LPCSTR lpstr, INT16 count, 
                                     INT16 cTabStops, const INT16 *lpTabPos )
 {
-    dprintf_info(text, "GetTabbedTextExtent: %04x '%.*s' %d\n",
+    TRACE(text, "%04x '%.*s' %d\n",
                   hdc, count, lpstr, count );
     return TEXT_TabbedTextOut( hdc, 0, 0, lpstr, count, cTabStops,
                                lpTabPos, NULL, 0, FALSE );
@@ -693,7 +693,7 @@
 DWORD WINAPI GetTabbedTextExtent32A( HDC32 hdc, LPCSTR lpstr, INT32 count, 
                                      INT32 cTabStops, const INT32 *lpTabPos )
 {
-    dprintf_info(text, "GetTabbedTextExtent: %04x '%.*s' %d\n",
+    TRACE(text, "%04x '%.*s' %d\n",
                   hdc, count, lpstr, count );
     return TEXT_TabbedTextOut( hdc, 0, 0, lpstr, count, cTabStops,
                                NULL, lpTabPos, 0, FALSE );