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/ANNOUNCE b/ANNOUNCE
index 99387fb..3eb02e4 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,13 +1,14 @@
-This is release 980301 of Wine, the MS Windows emulator.  This is still a
+This is release 980315 of Wine, the MS Windows emulator.  This is still a
 developer's only release.  There are many bugs and many unimplemented API
 features.  Most applications still do not work correctly.
 
 Patches should be submitted to "julliard@lrc.epfl.ch".  Please don't
 forget to include a ChangeLog entry.
 
-WHAT'S NEW with Wine-980301: (see ChangeLog for details)
-	- New debugging printfs scheme.
-	- Better DOS device handling.
+WHAT'S NEW with Wine-980315: (see ChangeLog for details)
+	- Preliminary ImageLists support.
+	- Beginnings of enhanced metafiles.
+	- More debugging macros changes.
 	- Lots of bug fixes.
 
 See the README file in the distribution for installation instructions.
@@ -16,10 +17,10 @@
 the release is available at the ftp sites.  The sources will be available
 from the following locations:
 
-  ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980301.tar.gz
-  ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980301.tar.gz
-  ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-980301.tar.gz
-  ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980301.tar.gz
+  ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980315.tar.gz
+  ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980315.tar.gz
+  ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-980315.tar.gz
+  ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980315.tar.gz
 
 It should also be available from any site that mirrors tsx-11 or sunsite.
 
diff --git a/AUTHORS b/AUTHORS
index 4580845..402ded9 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -55,11 +55,13 @@
 Jochen Karrer,
 Andreas Kirschbaum,
 Albrecht Kleine,
+Eric Kohl,
 Jon Konrath,
 Alex Korobka,
 Greg Kreider,
 Anand Kumria,
 Scott A. Laird,
+David Lee Lambert,
 Andrew Lewycky,
 Martin von Loewis,
 Michiel van Loon,
@@ -131,4 +133,5 @@
 James Youngman,
 Nikita V. Youshchenko,
 Mikolaj Zalewski,
-and John Zero.
+John Zero,
+and Luiz Otavio L. Zorzella.
diff --git a/ChangeLog b/ChangeLog
index a77cdc3..71d6ec2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,135 @@
 ----------------------------------------------------------------------
-Sun Feb 29 10:45:23 1997  Andreas Mohr <100.30936@germany.net>
+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.
+
+----------------------------------------------------------------------
+Sun Mar  1 10:45:23 1998  Andreas Mohr <100.30936@germany.net>
 
 	* [loader/ne_image.c]
 	Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
diff --git a/README b/README
index bd900e2..dd56ba1 100644
--- a/README
+++ b/README
@@ -11,17 +11,20 @@
 
 2. COMPILATION
 
-You must have one of:
+To compile the emulator, you must have one of:
 
 	Linux version 0.99.13 or above
 	NetBSD-current
 	FreeBSD-current or FreeBSD 1.1
 	OpenBSD/i386 2.1 or later
+	Solaris x86 2.5 or later
 
 You also need to have libXpm installed on your system. The sources for
 it are probably available on the ftp site where you got Wine. They can
 also be found on ftp.x.org and all its mirror sites.
 
+On x86 Systems gcc >= 2.7.0 is required. You will probably need flex too.
+
 To build Wine, first do a "./configure" and then a "make depend; make".
 This will build the library "libwine.a" and the program "wine".
 
diff --git a/configure b/configure
index 0aadfa3..f1a2e6f 100755
--- a/configure
+++ b/configure
@@ -2069,22 +2069,61 @@
 
 echo "$ac_t""$ac_cv_c_opensoundsystem" 1>&6
 
-if test "$ac_cv_c_opensoundsystem" = "yes"
+echo $ac_n "checking "for Open Sound System on *BSD"""... $ac_c" 1>&6
+echo "configure:2074: checking "for Open Sound System on *BSD"" >&5
+if eval "test \"`echo '$''{'ac_cv_c_opensoundsystem_bsd'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2079 "configure"
+#include "confdefs.h"
+#include <machine/soundcard.h>
+int main() {
+
+/* check for one of the Open Sound System specific SNDCTL_ defines */
+#if !defined(SNDCTL_DSP_STEREO)
+#error No open sound system
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2091: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_opensoundsystem_bsd="yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_opensoundsystem_bsd="no"
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_opensoundsystem_bsd" 1>&6
+
+if test "$ac_cv_c_opensoundsystem" = "yes" -o "$ac_cv_c_opensoundsystem_bsd" = "yes"
 then
     cat >> confdefs.h <<\EOF
 #define HAVE_OSS 1
 EOF
 
+    if test "$ac_cv_c_opensoundsystem_bsd" = "yes"
+    then
+        cat >> confdefs.h <<\EOF
+#define HAVE_MACHINE_SOUNDCARD_H 1
+EOF
+
+    fi
 fi
 
 
 echo $ac_n "checking "for union semun"""... $ac_c" 1>&6
-echo "configure:2083: checking "for union semun"" >&5
+echo "configure:2122: checking "for union semun"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_union_semun'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2088 "configure"
+#line 2127 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/sem.h>
@@ -2092,7 +2131,7 @@
 union semun foo
 ; return 0; }
 EOF
-if { (eval echo configure:2096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_union_semun="yes"
 else
@@ -2120,7 +2159,7 @@
 then
   CFLAGS="$CFLAGS -Wall"
   echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6
-echo "configure:2124: checking "for gcc strength-reduce bug"" >&5
+echo "configure:2163: checking "for gcc strength-reduce bug"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2128,7 +2167,7 @@
   ac_cv_c_gcc_strength_bug="yes"
 else
   cat > conftest.$ac_ext <<EOF
-#line 2132 "configure"
+#line 2171 "configure"
 #include "confdefs.h"
 
 int main(void) {
@@ -2139,7 +2178,7 @@
   exit( Array[1] != -2 );
 }
 EOF
-if { (eval echo configure:2143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_gcc_strength_bug="no"
 else
@@ -2162,7 +2201,7 @@
 
 
 echo $ac_n "checking "whether external symbols need an underscore prefix"""... $ac_c" 1>&6
-echo "configure:2166: checking "whether external symbols need an underscore prefix"" >&5
+echo "configure:2205: checking "whether external symbols need an underscore prefix"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_extern_prefix'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2174,14 +2213,14 @@
 	.long 0
 EOF
 cat > conftest.$ac_ext <<EOF
-#line 2178 "configure"
+#line 2217 "configure"
 #include "confdefs.h"
 extern int ac_test;
 int main() {
 if (ac_test) return 1
 ; return 0; }
 EOF
-if { (eval echo configure:2185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_c_extern_prefix="yes"
 else
@@ -2205,7 +2244,7 @@
 
 
 echo $ac_n "checking "whether assembler accepts .string"""... $ac_c" 1>&6
-echo "configure:2209: checking "whether assembler accepts .string"" >&5
+echo "configure:2248: checking "whether assembler accepts .string"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_asm_string'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2215,14 +2254,14 @@
 	.string "test"
 EOF
 cat > conftest.$ac_ext <<EOF
-#line 2219 "configure"
+#line 2258 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_c_asm_string="yes"
 else
@@ -2249,21 +2288,21 @@
 if test "$LIB_TARGET" = "libwine.so.1.0"
 then
   echo $ac_n "checking "whether we can build a dll"""... $ac_c" 1>&6
-echo "configure:2253: checking "whether we can build a dll"" >&5
+echo "configure:2292: checking "whether we can build a dll"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_dll'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   saved_cflags=$CFLAGS
   CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
   cat > conftest.$ac_ext <<EOF
-#line 2260 "configure"
+#line 2299 "configure"
 #include "confdefs.h"
 
 int main() {
 return 1
 ; return 0; }
 EOF
-if { (eval echo configure:2267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_c_dll="yes"
 else
@@ -2289,7 +2328,7 @@
 
 
 echo $ac_n "checking "for reentrant X libraries"""... $ac_c" 1>&6
-echo "configure:2293: checking "for reentrant X libraries"" >&5
+echo "configure:2332: checking "for reentrant X libraries"" >&5
 if eval "test \"`echo '$''{'wine_cv_x_reentrant'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2330,15 +2369,15 @@
 fi
 
 
-for ac_func in clone memmove strerror tcgetattr usleep wait4 waitpid
+for ac_func in clone memmove strerror tcgetattr timegm usleep wait4 waitpid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2337: checking for $ac_func" >&5
+echo "configure:2376: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2342 "configure"
+#line 2381 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2361,7 +2400,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2389,17 +2428,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2393: checking for $ac_hdr" >&5
+echo "configure:2432: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2398 "configure"
+#line 2437 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2426,12 +2465,12 @@
 done
 
 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:2430: checking whether stat file-mode macros are broken" >&5
+echo "configure:2469: checking whether stat file-mode macros are broken" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2435 "configure"
+#line 2474 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -2482,12 +2521,12 @@
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2486: checking for working const" >&5
+echo "configure:2525: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2491 "configure"
+#line 2530 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2536,7 +2575,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2557,12 +2596,12 @@
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2561: checking for ANSI C header files" >&5
+echo "configure:2600: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2566 "configure"
+#line 2605 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2570,7 +2609,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2613: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2587,7 +2626,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2591 "configure"
+#line 2630 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2605,7 +2644,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2609 "configure"
+#line 2648 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2626,7 +2665,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2630 "configure"
+#line 2669 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2637,7 +2676,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2661,12 +2700,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2665: checking for size_t" >&5
+echo "configure:2704: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2670 "configure"
+#line 2709 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
diff --git a/configure.in b/configure.in
index f02e30c..78a2c96 100644
--- a/configure.in
+++ b/configure.in
@@ -67,9 +67,22 @@
 #endif
 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
 
-if test "$ac_cv_c_opensoundsystem" = "yes"
+AC_CACHE_CHECK("for Open Sound System on *BSD",
+	ac_cv_c_opensoundsystem_bsd,
+	AC_TRY_COMPILE([#include <machine/soundcard.h>],[
+/* check for one of the Open Sound System specific SNDCTL_ defines */
+#if !defined(SNDCTL_DSP_STEREO)
+#error No open sound system
+#endif
+],ac_cv_c_opensoundsystem_bsd="yes",ac_cv_c_opensoundsystem_bsd="no"))
+
+if test "$ac_cv_c_opensoundsystem" = "yes" -o "$ac_cv_c_opensoundsystem_bsd" = "yes"
 then
     AC_DEFINE(HAVE_OSS)
+    if test "$ac_cv_c_opensoundsystem_bsd" = "yes"
+    then
+        AC_DEFINE(HAVE_MACHINE_SOUNDCARD_H)
+    fi
 fi
 
 dnl **** Check for union semun ****
@@ -204,7 +217,7 @@
 
 dnl **** Check for functions and header files ****
 
-AC_CHECK_FUNCS(clone memmove strerror tcgetattr usleep wait4 waitpid)
+AC_CHECK_FUNCS(clone memmove strerror tcgetattr timegm usleep wait4 waitpid)
 AC_CHECK_HEADERS(wctype.h)
 AC_HEADER_STAT()
 AC_C_CONST()
diff --git a/controls/combo.c b/controls/combo.c
index 4cacec7..8c84ea6 100644
--- a/controls/combo.c
+++ b/controls/combo.c
@@ -62,7 +62,7 @@
       CBitHeight = bm.bmHeight;
       CBitWidth  = bm.bmWidth;
 
-      dprintf_info(combo, "combo bitmap [%i,%i]\n", CBitWidth, CBitHeight );
+      TRACE(combo, "combo bitmap [%i,%i]\n", CBitWidth, CBitHeight );
 
       hPrevB = SelectObject16( hDC, hComboBmp);
       SetRect16( &r, 0, 0, CBitWidth, CBitHeight );
@@ -101,8 +101,8 @@
 	if( !(wnd->dwExStyle & WS_EX_NOPARENTNOTIFY) )
 	      lphc->wState |= CBF_NOTIFY;
 
-	dprintf_info(combo, "COMBO_NCCreate: [0x%08x], style = %08x\n", 
-						(UINT32)lphc, lphc->dwStyle );
+	TRACE(combo, "[0x%08x], style = %08x\n", 
+		     (UINT32)lphc, lphc->dwStyle );
 
 	return (LRESULT)(UINT32)wnd->hwndSelf; 
     }
@@ -119,7 +119,7 @@
    {
        WND*		wnd = lphc->self;
 
-       dprintf_info(combo,"Combo [%04x]: freeing storage\n", CB_HWND(lphc));
+       TRACE(combo,"[%04x]: freeing storage\n", CB_HWND(lphc));
 
        if( (CB_GETTYPE(lphc) != CBS_SIMPLE) && lphc->hWndLBox ) 
    	   DestroyWindow32( lphc->hWndLBox );
@@ -218,13 +218,18 @@
    if( lphc->droppedWidth > (lprLB->right - lprLB->left) )
        lprLB->right = lprLB->left + (INT16)lphc->droppedWidth;
 
-dprintf_info(combo,"Combo [%04x]: (%i,%i-%i,%i) placement\n\ttext\t= (%i,%i-%i,%i)\
-\n\tbutton\t= (%i,%i-%i,%i)\n\tlbox\t= (%i,%i-%i,%i)\n", CB_HWND(lphc),
-lphc->RectCombo.left, lphc->RectCombo.top, lphc->RectCombo.right, lphc->RectCombo.bottom,
-lprEdit->left, lprEdit->top, lprEdit->right, lprEdit->bottom,
-lprButton->left, lprButton->top, lprButton->right, lprButton->bottom, 
-lprLB->left, lprLB->top, lprLB->right, lprLB->bottom );
+   TRACE(combo,"[%04x]: (%i,%i-%i,%i) placement\n",
+		CB_HWND(lphc), lphc->RectCombo.left, lphc->RectCombo.top, 
+		lphc->RectCombo.right, lphc->RectCombo.bottom);
 
+   TRACE(combo,"\ttext\t= (%i,%i-%i,%i)\n",
+		lprEdit->left, lprEdit->top, lprEdit->right, lprEdit->bottom);
+
+   TRACE(combo,"\tbutton\t= (%i,%i-%i,%i)\n",
+		lprButton->left, lprButton->top, lprButton->right, lprButton->bottom);
+
+   TRACE(combo,"\tlbox\t= (%i,%i-%i,%i)\n", 
+		lprLB->left, lprLB->top, lprLB->right, lprLB->bottom );
 }
 
 /***********************************************************************
@@ -337,12 +342,12 @@
 				SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
 		lphc->wState &= ~CBF_NORESIZE;
 	      }
-	      dprintf_info(combo,"COMBO_Create: init done\n");
+	      TRACE(combo,"init done\n");
 	      return wnd->hwndSelf;
 	  }
-	  dprintf_err(combo, "COMBO_Create: edit control failure.\n");
-      } else dprintf_err(combo, "COMBO_Create: listbox failure.\n");
-  } else dprintf_err(combo, "COMBO_Create: no owner for visible combo.\n");
+	  ERR(combo, "edit control failure.\n");
+      } else ERR(combo, "listbox failure.\n");
+  } else ERR(combo, "no owner for visible combo.\n");
 
   /* CreateWindow() will send WM_NCDESTROY to cleanup */
 
@@ -561,7 +566,7 @@
    if( length > 0 ) 
        pText = (LPSTR) HeapAlloc( GetProcessHeap(), 0, length + 1);
 
-   dprintf_info(combo,"\tCBUpdateLBox: edit text length %i\n", length );
+   TRACE(combo,"\t edit text length %i\n", length );
 
    if( pText )
    {
@@ -597,7 +602,7 @@
    INT32	length;
    LPSTR	pText = NULL;
 
-   dprintf_info(combo,"\tCBUpdateEdit: %i\n", index );
+   TRACE(combo,"\t %i\n", index );
 
    if( index == -1 )
    {
@@ -642,7 +647,7 @@
    RECT16	rect;
    LPRECT16	pRect = NULL;
 
-   dprintf_info(combo,"Combo [%04x]: drop down\n", CB_HWND(lphc));
+   TRACE(combo,"[%04x]: drop down\n", CB_HWND(lphc));
 
    CB_NOTIFY( lphc, CBN_DROPDOWN );
 
@@ -698,7 +703,7 @@
    if( IsWindow32( hWnd ) && CB_GETTYPE(lphc) != CBS_SIMPLE )
    {
 
-       dprintf_info(combo,"Combo [%04x]: roll up [%i]\n", CB_HWND(lphc), (INT32)ok );
+       TRACE(combo,"[%04x]: roll up [%i]\n", CB_HWND(lphc), (INT32)ok );
 
        /* always send WM_LBUTTONUP? */
        SendMessage32A( lphc->hWndLBox, WM_LBUTTONUP, 0, (LPARAM)(-1) );
@@ -839,16 +844,16 @@
        {   
 	   case (EN_SETFOCUS >> 8):
 
-		dprintf_info(combo,"Combo [%04x]: edit [%04x] got focus\n", 
-				     CB_HWND(lphc), (HWND16)lphc->hWndEdit );
+		TRACE(combo,"[%04x]: edit [%04x] got focus\n", 
+			     CB_HWND(lphc), (HWND16)lphc->hWndEdit );
 
 		if( !(lphc->wState & CBF_FOCUSED) ) COMBO_SetFocus( lphc );
 	        break;
 
 	   case (EN_KILLFOCUS >> 8):
 
-		dprintf_info(combo,"Combo [%04x]: edit [%04x] lost focus\n",
-				      CB_HWND(lphc), (HWND16)lphc->hWndEdit );
+		TRACE(combo,"[%04x]: edit [%04x] lost focus\n",
+			     CB_HWND(lphc), (HWND16)lphc->hWndEdit );
 
 		/* NOTE: it seems that Windows' edit control sends an
 		 * undocumented message WM_USER + 0x1B instead of this
@@ -888,8 +893,8 @@
 	   case LBN_SELCHANGE:
 	   case LBN_SELCANCEL:
 
-		dprintf_info(combo,"Combo [%04x]: lbox selection change [%04x]\n", 
-						      CB_HWND(lphc), lphc->wState );
+		TRACE(combo,"[%04x]: lbox selection change [%04x]\n", 
+			     CB_HWND(lphc), lphc->wState );
 
 		/* do not roll up if selection is being tracked 
 		 * by arrowkeys in the dropdown listbox */
@@ -922,8 +927,8 @@
 {
    HWND32	hWnd = lphc->self->hwndSelf;
 
-   dprintf_info(combo,"Combo [%04x]: ownerdraw op %04x\n", 
-				       CB_HWND(lphc), (UINT16)msg );
+   TRACE(combo,"[%04x]: ownerdraw op %04x\n", 
+		CB_HWND(lphc), (UINT16)msg );
 
 #define lpIS    ((LPDELETEITEMSTRUCT32)lParam)
 
@@ -1060,7 +1065,7 @@
   GetWindowRect16( lphc->self->hwndSelf, &rect );
   w = rect.right - rect.left; h = rect.bottom - rect.top;
 
-  dprintf_info(combo,"COMBO_Size: w = %i, h = %i\n", w, h );
+  TRACE(combo,"w = %i, h = %i\n", w, h );
 
   /* CreateWindow() may send a bogus WM_SIZE, ignore it */
 
@@ -1257,8 +1262,8 @@
     {
       LPHEADCOMBO	lphc = CB_GETPTR(pWnd);
 
-      dprintf_info(combo, "Combo [%04x]: msg %s wp %08x lp %08lx\n",
-                     pWnd->hwndSelf, SPY_GetMsgName(message), wParam, lParam );
+      TRACE(combo, "[%04x]: msg %s wp %08x lp %08lx\n",
+		   pWnd->hwndSelf, SPY_GetMsgName(message), wParam, lParam );
 
       if( lphc || message == WM_NCCREATE )
       switch(message) 
@@ -1559,7 +1564,7 @@
 		return (lphc->wState & CBF_EUI) ? TRUE : FALSE;
 
 	case (WM_USER + 0x1B):
-	        dprintf_warn(combo, "Combo [%04x]: undocumented msg!\n", (HWND16)hwnd );
+	        WARN(combo, "[%04x]: undocumented msg!\n", (HWND16)hwnd );
     }
     return DefWindowProc32A(hwnd, message, wParam, lParam);
   }
diff --git a/controls/edit.c b/controls/edit.c
index 35b774f..ab11776 100644
--- a/controls/edit.c
+++ b/controls/edit.c
@@ -49,7 +49,7 @@
 	END_0 = 0,	/* line ends with terminating '\0' character */
 	END_WRAP,	/* line is wrapped */
 	END_HARD,	/* line ends with a hard return '\r\n' */
-	END_SOFT,	/* line ends with a soft return '\r\r\n' */
+	END_SOFT	/* line ends with a soft return '\r\r\n' */
 } LINE_END;
 
 typedef struct tagLINEDEF {
@@ -109,9 +109,8 @@
 #define ORDER_UINT32(x,y) do { if ((UINT32)(y) < (UINT32)(x)) SWAP_UINT32((x),(y)); } while(0)
 
 #define DPRINTF_EDIT_NOTIFY(hwnd, str) \
-	({dprintf_info(edit, \
-			"edit: notification " str " sent to hwnd=%08x\n", \
-			(UINT32)(hwnd));})
+	({TRACE(edit, "notification " str " sent to hwnd=%08x\n", \
+		       (UINT32)(hwnd));})
 
 #define EDIT_SEND_CTLCOLOR(wnd,hdc) \
 	(SendMessage32A((wnd)->parent->hwndSelf, WM_CTLCOLOREDIT, \
@@ -122,14 +121,13 @@
 			MAKEWPARAM((wnd)->wIDmenu, wNotifyCode), \
 			(LPARAM)(wnd)->hwndSelf))
 #define DPRINTF_EDIT_MSG16(str) \
-	dprintf_info(edit, \
-			"edit: 16 bit : " str ": hwnd=%08x, wParam=%08x, lParam=%08x\n", \
-			(UINT32)hwnd, (UINT32)wParam, (UINT32)lParam)
+	TRACE(edit, \
+		     "16 bit : " str ": hwnd=%08x, wParam=%08x, lParam=%08x\n", \
+		     (UINT32)hwnd, (UINT32)wParam, (UINT32)lParam)
 #define DPRINTF_EDIT_MSG32(str) \
-	dprintf_info(edit, \
-			"edit: 32 bit : " str ": hwnd=%08x, wParam=%08x, lParam=%08x\n", \
-			(UINT32)hwnd, (UINT32)wParam, (UINT32)lParam)
-
+	TRACE(edit, \
+		     "32 bit : " str ": hwnd=%08x, wParam=%08x, lParam=%08x\n", \
+		     (UINT32)hwnd, (UINT32)wParam, (UINT32)lParam)
 
 /*********************************************************************
  *
@@ -986,7 +984,7 @@
 	}
         else if (es->word_break_proc32A)
         {
-            dprintf_info(relay, "CallTo32(wordbrk=%p,str='%s',idx=%d,cnt=%d,act=%d)\n",
+            TRACE(relay, "(wordbrk=%p,str='%s',idx=%d,cnt=%d,act=%d)\n",
                            es->word_break_proc32A, es->text + start, index,
                            count, action );
             return (INT32)es->word_break_proc32A( es->text + start, index,
@@ -1168,7 +1166,7 @@
 static void EDIT_LockBuffer(WND *wnd, EDITSTATE *es)
 {
 	if (!es) {
-		fprintf(stderr, "edit: LockBuffer() without an EDITSTATE ... please report\n");
+		ERR(edit, "no EDITSTATE ... please report\n");
 		return;
 	}
 	if (!(es->style & ES_MULTILINE))
@@ -1179,7 +1177,7 @@
 		else if (es->hloc16)
 			es->text = LOCAL_Lock(wnd->hInstance, es->hloc16);
 		else {
-			fprintf(stderr, "edit: LockBuffer() without a buffer ... please report\n");
+			ERR(edit, "no buffer ... please report\n");
 			return;
 		}
 	}
@@ -1318,7 +1316,7 @@
 	if (size > es->buffer_limit)
 		size = es->buffer_limit;
 
-	dprintf_info(edit, "edit: EDIT_MakeFit: trying to ReAlloc to %d+1\n", size);
+	TRACE(edit, "trying to ReAlloc to %d+1\n", size);
 
 	EDIT_UnlockBuffer(wnd, es, TRUE);
 	if (es->text) {
@@ -1328,25 +1326,25 @@
 			es->buffer_size = 0;
 	} else if (es->hloc32) {
 		if ((hNew32 = LocalReAlloc32(es->hloc32, size + 1, 0))) {
-			dprintf_info(edit, "edit: EDIT_MakeFit: Old 32 bit handle %08x, new handle %08x\n", es->hloc32, hNew32);
+			TRACE(edit, "Old 32 bit handle %08x, new handle %08x\n", es->hloc32, hNew32);
 			es->hloc32 = hNew32;
 			es->buffer_size = MIN(LocalSize32(es->hloc32) - 1, es->buffer_limit);
 		}
 	} else if (es->hloc16) {
 		if ((hNew16 = LOCAL_ReAlloc(wnd->hInstance, es->hloc16, size + 1, LMEM_MOVEABLE))) {
-			dprintf_info(edit, "edit: EDIT_MakeFit: Old 16 bit handle %08x, new handle %08x\n", es->hloc16, hNew16);
+			TRACE(edit, "Old 16 bit handle %08x, new handle %08x\n", es->hloc16, hNew16);
 			es->hloc16 = hNew16;
 			es->buffer_size = MIN(LOCAL_Size(wnd->hInstance, es->hloc16) - 1, es->buffer_limit);
 		}
 	}
 	if (es->buffer_size < size) {
 		EDIT_LockBuffer(wnd, es);
-		dprintf_warn(edit, "edit: EDIT_MakeFit: FAILED !  We now have %d+1\n", es->buffer_size);
+		WARN(edit, "FAILED !  We now have %d+1\n", es->buffer_size);
 		EDIT_NOTIFY_PARENT(wnd, EN_ERRSPACE, "EN_ERRSPACE");
 		return FALSE;
 	} else {
 		EDIT_LockBuffer(wnd, es);
-		dprintf_info(edit, "edit: EDIT_MakeFit: We now have %d+1\n", es->buffer_size);
+		TRACE(edit, "We now have %d+1\n", es->buffer_size);
 		return TRUE;
 	}
 }
@@ -1365,12 +1363,12 @@
 		return TRUE;
 	size = ((size / GROWLENGTH) + 1) * GROWLENGTH;
 
-	dprintf_info(edit, "edit: EDIT_MakeUndoFit: trying to ReAlloc to %d+1\n", size);
+	TRACE(edit, "trying to ReAlloc to %d+1\n", size);
 
 	if ((es->undo_text = HeapReAlloc(es->heap, 0, es->undo_text, size + 1))) {
 		es->undo_buffer_size = HeapSize(es->heap, 0, es->undo_text) - 1;
 		if (es->undo_buffer_size < size) {
-			dprintf_warn(edit, "edit: EDIT_MakeUndoFit: FAILED !  We now have %d+1\n", es->undo_buffer_size);
+			WARN(edit, "FAILED !  We now have %d+1\n", es->undo_buffer_size);
 			return FALSE;
 		}
 		return TRUE;
@@ -1658,7 +1656,7 @@
 	} else if (line)
 		return;
 
-	dprintf_info(edit, "edit: EDIT_PaintLine: line=%d\n", line);
+	TRACE(edit, "line=%d\n", line);
 
 	pos = EDIT_EM_PosFromChar(wnd, es, EDIT_EM_LineIndex(wnd, es, line), FALSE);
 	x = SLOWORD(pos);
@@ -1826,17 +1824,17 @@
 static void EDIT_UnlockBuffer(WND *wnd, EDITSTATE *es, BOOL32 force)
 {
 	if (!es) {
-		fprintf(stderr, "edit: UnlockBuffer() without an EDITSTATE ... please report\n");
+		ERR(edit, "no EDITSTATE ... please report\n");
 		return;
 	}
 	if (!(es->style & ES_MULTILINE))
 		return;
 	if (!es->lock_count) {
-		fprintf(stderr, "edit: UnlockBuffer() with lock_count == 0 ... please report\n");
+		ERR(edit, "lock_count == 0 ... please report\n");
 		return;
 	}
 	if (!es->text) {
-		fprintf(stderr, "edit: UnlockBuffer() with es->text == 0 ... please report\n");
+		ERR(edit, "es->text == 0 ... please report\n");
 		return;
 	}
 	if (force || (es->lock_count == 1)) {
@@ -1867,8 +1865,8 @@
 {
 	INT32 ret = 0;
 
-	dprintf_info(edit, "edit: EDIT_WordBreakProc: s=%p, index=%u"
-			", count=%u, action=%d\n", s, index, count, action);
+	TRACE(edit, "s=%p, index=%u, count=%u, action=%d\n", 
+		     s, index, count, action);
 
 	switch (action) {
 	case WB_LEFT:
@@ -1911,7 +1909,7 @@
 		ret = (s[index] == ' ');
 		break;
 	default:
-		fprintf(stderr, "edit: EDIT_WordBreakProc: unknown action code, please report !\n");
+		ERR(edit, "unknown action code, please report !\n");
 		break;
 	}
 	return ret;
@@ -1953,7 +1951,7 @@
  */
 static BOOL32 EDIT_EM_FmtLines(WND *wnd, EDITSTATE *es, BOOL32 add_eol)
 {
-	fprintf(stdnimp, "edit: EM_FMTLINES: message not implemented\n");
+	FIXME(edit, "message not implemented\n");
 	return add_eol;
 }
 
@@ -1989,12 +1987,12 @@
 		return (HLOCAL32)es->hloc16;
 
 	if (!(newBuf = LocalAlloc32(LMEM_MOVEABLE, lstrlen32A(es->text) + 1))) {
-		fprintf(stderr, "edit: EM_GETHANDLE: could not allocate new 32 bit buffer\n");
+		ERR(edit, "could not allocate new 32 bit buffer\n");
 		return 0;
 	}
 	newSize = MIN(LocalSize32(newBuf) - 1, es->buffer_limit);
 	if (!(newText = LocalLock32(newBuf))) {
-		fprintf(stderr, "edit: EM_GETHANDLE: could not lock new 32 bit buffer\n");
+		ERR(edit, "could not lock new 32 bit buffer\n");
 		LocalFree32(newBuf);
 		return 0;
 	}
@@ -2007,7 +2005,7 @@
 	es->buffer_size = newSize;
 	es->text = newText;
 	EDIT_LockBuffer(wnd, es);
-	dprintf_info(edit, "edit: EM_GETHANDLE: switched to 32 bit local heap\n");
+	TRACE(edit, "switched to 32 bit local heap\n");
 
 	return es->hloc32;
 }
@@ -2043,18 +2041,18 @@
 	if (!LOCAL_HeapSize(wnd->hInstance)) {
 		if (!LocalInit(wnd->hInstance, 0,
 				GlobalSize16(wnd->hInstance))) {
-			fprintf(stderr, "edit: EM_GETHANDLE: could not initialize local heap\n");
+			ERR(edit, "could not initialize local heap\n");
 			return 0;
 		}
-		dprintf_info(edit, "edit: EM_GETHANDLE: local heap initialized\n");
+		TRACE(edit, "local heap initialized\n");
 	}
 	if (!(newBuf = LOCAL_Alloc(wnd->hInstance, LMEM_MOVEABLE, lstrlen32A(es->text) + 1))) {
-		fprintf(stderr, "edit: EM_GETHANDLE: could not allocate new 16 bit buffer\n");
+		ERR(edit, "could not allocate new 16 bit buffer\n");
 		return 0;
 	}
 	newSize = MIN(LOCAL_Size(wnd->hInstance, newBuf) - 1, es->buffer_limit);
 	if (!(newText = LOCAL_Lock(wnd->hInstance, newBuf))) {
-		fprintf(stderr, "edit: EM_GETHANDLE: could not lock new 16 bit buffer\n");
+		ERR(edit, "could not lock new 16 bit buffer\n");
 		LOCAL_Free(wnd->hInstance, newBuf);
 		return 0;
 	}
@@ -2071,7 +2069,7 @@
 	es->buffer_size = newSize;
 	es->text = newText;
 	EDIT_LockBuffer(wnd, es);
-	dprintf_info(edit, "edit: EM_GETHANDLE: switched to 16 bit buffer\n");
+	TRACE(edit, "switched to 16 bit buffer\n");
 
 	return es->hloc16;
 }
@@ -2504,7 +2502,7 @@
 		return;
 
 	if (!hloc) {
-		fprintf(stderr, "edit: EM_SETHANDLE called with NULL handle\n");
+		WARN(edit, "called with NULL handle\n");
 		return;
 	}
 
@@ -2547,7 +2545,7 @@
 		return;
 
 	if (!hloc) {
-		fprintf(stderr, "edit: EM_SETHANDLE called with NULL handle\n");
+		WARN(edit, "called with NULL handle\n");
 		return;
 	}
 
@@ -2623,7 +2621,7 @@
 		if (action & EC_RIGHTMARGIN)
 			es->right_margin = right;
 	}
-	dprintf_info(edit, "EDIT_EM_SetMargins: left=%d, right=%d\n", es->left_margin, es->right_margin);
+	TRACE(edit, "left=%d, right=%d\n", es->left_margin, es->right_margin);
 }
 
 
@@ -2809,8 +2807,8 @@
 
 	lstrcpy32A(utext, es->undo_text);
 
-	dprintf_info(edit, "edit: before UNDO:insertion length = %d, deletion buffer = %s\n",
-			es->undo_insert_count, utext);
+	TRACE(edit, "before UNDO:insertion length = %d, deletion buffer = %s\n",
+		     es->undo_insert_count, utext);
 
 	EDIT_EM_SetSel(wnd, es, es->undo_position, es->undo_position + es->undo_insert_count, FALSE);
 	EDIT_EM_EmptyUndoBuffer(wnd, es);
@@ -2818,7 +2816,7 @@
 	EDIT_EM_SetSel(wnd, es, es->undo_position, es->undo_position + es->undo_insert_count, FALSE);
 	HeapFree(es->heap, 0, utext);
 
-	dprintf_info(edit, "edit: after UNDO: insertion length = %d, deletion buffer = %s\n",
+	TRACE(edit, "after UNDO:insertion length = %d, deletion buffer = %s\n",
 			es->undo_insert_count, es->undo_text);
 
 	return TRUE;
@@ -2890,7 +2888,7 @@
 			EDIT_EM_ScrollCaret(wnd, es);
 			break;
 		default:
-			dprintf_err(edit, "edit: unknown menu item, please report\n");
+			ERR(edit, "unknown menu item, please report\n");
 			break;
 	}
 }
@@ -3135,9 +3133,9 @@
 	LRESULT ret = 0;
 
 	if (!(es->flags & EF_HSCROLL_HACK)) {
-		fprintf(stderr, "edit: hacked WM_HSCROLL handler invoked\n");
-		fprintf(stderr, "      if you are _not_ running 16 bit notepad, please report\n");
-		fprintf(stderr, "      (this message is only displayed once per edit control)\n");
+		ERR(edit, "hacked WM_HSCROLL handler invoked\n");
+		ERR(edit, "      if you are _not_ running 16 bit notepad, please report\n");
+		ERR(edit, "      (this message is only displayed once per edit control)\n");
 		es->flags |= EF_HSCROLL_HACK;
 	}
 
@@ -3192,7 +3190,7 @@
 		break;
 
 	default:
-		dprintf_err(edit, "edit: undocumented (hacked) WM_HSCROLL parameter, please report\n");
+		ERR(edit, "undocumented (hacked) WM_HSCROLL parameter, please report\n");
 		return 0;
 	}
 	if (dx)
@@ -3262,7 +3260,7 @@
 		break;
 
 	default:
-		fprintf(stderr, "edit: undocumented WM_HSCROLL parameter, please report\n");
+		ERR(edit, "undocumented WM_HSCROLL parameter, please report\n");
 		return 0;
 	}
 	if (dx)
@@ -3285,8 +3283,8 @@
 		HWND32 hCombo = wnd->parent->hwndSelf;
 		BOOL32 bUIFlip = TRUE;
 
-		dprintf_info(combo, "EDIT_CheckCombo [%04x]: handling msg %04x (%04x)\n",
-					wnd->hwndSelf, (UINT16)msg, (UINT16)key);
+		TRACE(combo, "[%04x]: handling msg %04x (%04x)\n",
+			     wnd->hwndSelf, (UINT16)msg, (UINT16)key);
 
 		switch (msg) {
 		case WM_KEYDOWN: /* Handle F4 and arrow keys */
@@ -3718,7 +3716,7 @@
 {
 	EDIT_EM_SetSel(wnd, es, 0, -1, FALSE);
 	if (text) {
-		dprintf_info(edit, "\t'%s'\n", text);
+		TRACE(edit, "\t'%s'\n", text);
 		EDIT_EM_ReplaceSel(wnd, es, FALSE, text);
 		es->x_offset = 0;
 	}
@@ -3796,9 +3794,9 @@
 	LRESULT ret = 0;
 
 	if (!(es->flags & EF_VSCROLL_HACK)) {
-		fprintf(stderr, "edit: hacked WM_VSCROLL handler invoked\n");
-		fprintf(stderr, "      if you are _not_ running 16 bit notepad, please report\n");
-		fprintf(stderr, "      (this message is only displayed once per edit control)\n");
+		ERR(edit, "hacked WM_VSCROLL handler invoked\n");
+		ERR(edit, "      if you are _not_ running 16 bit notepad, please report\n");
+		ERR(edit, "      (this message is only displayed once per edit control)\n");
 		es->flags |= EF_VSCROLL_HACK;
 	}
 
@@ -3841,7 +3839,7 @@
 		break;
 
 	default:
-		fprintf(stderr, "edit: undocumented (hacked) WM_VSCROLL parameter, please report\n");
+		ERR(edit, "undocumented (hacked) WM_VSCROLL parameter, please report\n");
 		return 0;
 	}
 	if (dy)
@@ -3898,7 +3896,7 @@
 		break;
 
 	default:
-		fprintf(stderr, "edit: undocumented WM_VSCROLL parameter, please report\n");
+		ERR(edit, "undocumented WM_VSCROLL parameter, please report\n");
 		return 0;
 	}
 	if (dy)
diff --git a/controls/listbox.c b/controls/listbox.c
index c1512e7..a985520 100644
--- a/controls/listbox.c
+++ b/controls/listbox.c
@@ -308,9 +308,9 @@
         if ((descr->height > descr->item_height) &&
             (descr->height % descr->item_height))
         {
-            dprintf_info(listbox, "Listbox %04x: changing height %d -> %d\n",
-                            wnd->hwndSelf, descr->height,
-                            descr->height - descr->height%descr->item_height );
+            TRACE(listbox, "[%04x]: changing height %d -> %d\n",
+			 wnd->hwndSelf, descr->height,
+			 descr->height - descr->height%descr->item_height );
             SetWindowPos32( wnd->hwndSelf, 0, 0, 0,
                             wnd->rectWindow.right - wnd->rectWindow.left,
                             wnd->rectWindow.bottom - wnd->rectWindow.top -
@@ -319,8 +319,8 @@
             return;
         }
     }
-    dprintf_info(listbox, "Listbox %04x: new size = %d,%d\n",
-                     wnd->hwndSelf, descr->width, descr->height );
+    TRACE(listbox, "[%04x]: new size = %d,%d\n",
+		 wnd->hwndSelf, descr->width, descr->height );
     LISTBOX_UpdatePage( wnd, descr );
     LISTBOX_UpdateScroll( wnd, descr );
 }
@@ -457,11 +457,11 @@
         if (wnd->dwStyle & WS_DISABLED) dis.itemState |= ODS_DISABLED;
         dis.itemData     = item ? item->data : 0;
         dis.rcItem       = *rect;
-        dprintf_info(listbox, "Listbox %04x: drawitem %d (%s) action=%02x "
-                         "state=%02x rect=%d,%d-%d,%d\n",
-                         wnd->hwndSelf, index, item ? item->str : "", action,
-                         dis.itemState, rect->left, rect->top,
-                         rect->right, rect->bottom );
+        TRACE(listbox, "[%04x]: drawitem %d (%s) action=%02x "
+		     "state=%02x rect=%d,%d-%d,%d\n",
+		     wnd->hwndSelf, index, item ? item->str : "", action,
+		     dis.itemState, rect->left, rect->top,
+		     rect->right, rect->bottom );
         SendMessage32A(descr->owner, WM_DRAWITEM, id, (LPARAM)&dis);
     }
     else
@@ -479,10 +479,10 @@
             oldText = SetTextColor32( hdc, GetSysColor32(COLOR_HIGHLIGHTTEXT));
         }
 
-        dprintf_info(listbox, "Listbox %04x: painting %d (%s) action=%02x "
-                         "rect=%d,%d-%d,%d\n",
-                         wnd->hwndSelf, index, item ? item->str : "", action,
-                         rect->left, rect->top, rect->right, rect->bottom );
+        TRACE(listbox, "[%04x]: painting %d (%s) action=%02x "
+		     "rect=%d,%d-%d,%d\n",
+		     wnd->hwndSelf, index, item ? item->str : "", action,
+		     rect->left, rect->top, rect->right, rect->bottom );
         if (!item)
             ExtTextOut32A( hdc, rect->left + 1, rect->top + 1,
                            ETO_OPAQUE | ETO_CLIPPED, rect, NULL, 0, NULL );
@@ -606,11 +606,11 @@
 
         for (i = 0; i < descr->nb_tabs; i++) {
 	    descr->tabs[i] = *p++<<1; /* FIXME */
-	    if(debugging_info(listbox))
+	    if(TRACE_ON(listbox))
               dsprintf(listbox, "%hd ", descr->tabs[i]);
 	}
-        dprintf_info(listbox, "Listbox %04x: settabstops %s\n", 
-			 wnd->hwndSelf, dbg_str(listbox));
+        TRACE(listbox, "[%04x]: settabstops %s\n", 
+		     wnd->hwndSelf, dbg_str(listbox));
     }
     else memcpy( descr->tabs, tabs, descr->nb_tabs * sizeof(INT32) );
     /* FIXME: repaint the window? */
@@ -988,16 +988,16 @@
     if (descr->style & LBS_OWNERDRAWVARIABLE)
     {
         if ((index < 0) || (index >= descr->nb_items)) return LB_ERR;
-        dprintf_info(listbox, "Listbox %04x: item %d height = %d\n",
-                         wnd->hwndSelf, index, height );
+        TRACE(listbox, "[%04x]: item %d height = %d\n",
+		     wnd->hwndSelf, index, height );
         descr->items[index].height = height;
         LISTBOX_UpdateScroll( wnd, descr );
         LISTBOX_InvalidateItems( wnd, descr, index );
     }
     else if (height != descr->item_height)
     {
-        dprintf_info(listbox, "Listbox %04x: new height = %d\n",
-                         wnd->hwndSelf, height );
+        TRACE(listbox, "[%04x]: new height = %d\n",
+		     wnd->hwndSelf, height );
         descr->item_height = height;
         LISTBOX_UpdatePage( wnd, descr );
         LISTBOX_UpdateScroll( wnd, descr );
@@ -1018,8 +1018,8 @@
         pos = descr->horz_extent - descr->width;
     if (pos < 0) pos = 0;
     if (!(diff = descr->horz_pos - pos)) return;
-    dprintf_info(listbox, "Listbox %04x: new horz pos = %d\n",
-                     wnd->hwndSelf, pos );
+    TRACE(listbox, "[%04x]: new horz pos = %d\n",
+		 wnd->hwndSelf, pos );
     descr->horz_pos = pos;
     LISTBOX_UpdateScroll( wnd, descr );
     if (abs(diff) < descr->width)
@@ -1040,8 +1040,8 @@
         return LB_OKAY;
     if (extent <= 0) extent = 1;
     if (extent == descr->horz_extent) return LB_OKAY;
-    dprintf_info(listbox, "Listbox %04x: new horz extent = %d\n",
-                     wnd->hwndSelf, extent );
+    TRACE(listbox, "[%04x]: new horz extent = %d\n",
+		 wnd->hwndSelf, extent );
     descr->horz_extent = extent;
     if (descr->horz_pos > extent - descr->width)
         LISTBOX_SetHorizontalPos( wnd, descr, extent - descr->width );
@@ -1058,8 +1058,8 @@
 {
     width += 2;  /* For left and right margin */
     if (width == descr->column_width) return LB_OKAY;
-    dprintf_info(listbox, "Listbox %04x: new column width = %d\n",
-                     wnd->hwndSelf, width );
+    TRACE(listbox, "[%04x]: new column width = %d\n",
+		 wnd->hwndSelf, width );
     descr->column_width = width;
     LISTBOX_UpdatePage( wnd, descr );
     return LB_OKAY;
@@ -1081,7 +1081,7 @@
 
     if (!(hdc = GetDCEx32( wnd->hwndSelf, 0, DCX_CACHE )))
     {
-        fprintf( stderr, "LISTBOX_SetFont: unable to get DC\n" );
+        ERR(listbox, "unable to get DC.\n" );
         return 16;
     }
     if (font) oldFont = SelectObject32( hdc, font );
@@ -1307,8 +1307,8 @@
         mis.itemHeight = descr->item_height;
         SendMessage32A( descr->owner, WM_MEASUREITEM, id, (LPARAM)&mis );
         item->height = mis.itemHeight ? mis.itemHeight : 1;
-        dprintf_info(listbox, "Listbox %04x: measure item %d (%s) = %d\n",
-                         wnd->hwndSelf, index, str ? str : "", item->height );
+        TRACE(listbox, "[%04x]: measure item %d (%s) = %d\n",
+		     wnd->hwndSelf, index, str ? str : "", item->height );
     }
 
     /* Repaint the items */
@@ -1359,8 +1359,8 @@
         return ret;
     }
 
-    dprintf_info(listbox, "Listbox %04x: added item %d '%s'\n",
-                     wnd->hwndSelf, index, HAS_STRINGS(descr) ? new_str : "" );
+    TRACE(listbox, "[%04x]: added item %d '%s'\n",
+		 wnd->hwndSelf, index, HAS_STRINGS(descr) ? new_str : "" );
     return index;
 }
 
@@ -1696,8 +1696,8 @@
                                           WPARAM32 wParam, INT32 x, INT32 y )
 {
     INT32 index = LISTBOX_GetItemFromPoint( wnd, descr, x, y );
-    dprintf_info(listbox, "Listbox %04x: lbuttondown %d,%d item %d\n",
-                     wnd->hwndSelf, x, y, index );
+    TRACE(listbox, "[%04x]: lbuttondown %d,%d item %d\n",
+		 wnd->hwndSelf, x, y, index );
     if (!descr->caret_on && (GetFocus32() == wnd->hwndSelf)) return 0;
     if (index != -1)
     {
@@ -2031,8 +2031,8 @@
 
     if( lphc )
     {
-	dprintf_info(combo,"ComboLBox [%04x]: resetting owner %04x -> %04x\n",
-			      wnd->hwndSelf, descr->owner, lphc->self->hwndSelf );
+	TRACE(combo,"[%04x]: resetting owner %04x -> %04x\n",
+		     wnd->hwndSelf, descr->owner, lphc->self->hwndSelf );
 	descr->owner = lphc->self->hwndSelf;
     }
 
@@ -2100,16 +2100,16 @@
         if (msg == WM_CREATE)
         {
             if (!LISTBOX_Create( wnd, NULL )) return -1;
-            dprintf_info(listbox, "Listbox: creating wnd=%04x descr=%p\n",
-                             hwnd, *(LB_DESCR **)wnd->wExtra );
+            TRACE(listbox, "creating wnd=%04x descr=%p\n",
+			 hwnd, *(LB_DESCR **)wnd->wExtra );
             return 0;
         }
         /* Ignore all other messages before we get a WM_CREATE */
         return DefWindowProc32A( hwnd, msg, wParam, lParam );
     }
 
-    dprintf_info(listbox, "Listbox %04x: msg %s wp %08x lp %08lx\n",
-                     wnd->hwndSelf, SPY_GetMsgName(msg), wParam, lParam );
+    TRACE(listbox, "[%04x]: msg %s wp %08x lp %08lx\n",
+		 wnd->hwndSelf, SPY_GetMsgName(msg), wParam, lParam );
     switch(msg)
     {
     case LB_RESETCONTENT16:
@@ -2478,8 +2478,8 @@
 
     default:
         if ((msg >= WM_USER) && (msg < 0xc000))
-            dprintf_warn(listbox, "Listbox %04x: unknown msg %04x wp %08x lp %08lx\n",
-                    hwnd, msg, wParam, lParam );
+            WARN(listbox, "[%04x]: unknown msg %04x wp %08x lp %08lx\n",
+			 hwnd, msg, wParam, lParam );
         return DefWindowProc32A( hwnd, msg, wParam, lParam );
     }
     return 0;
@@ -2523,8 +2523,8 @@
     {
 	LB_DESCR *descr = *(LB_DESCR **)wnd->wExtra;
 
-        dprintf_info(combo, "ComboLBox [%04x]: msg %s wp %08x lp %08lx\n",
-                       wnd->hwndSelf, SPY_GetMsgName(msg), wParam, lParam );
+        TRACE(combo, "[%04x]: msg %s wp %08x lp %08lx\n",
+		     wnd->hwndSelf, SPY_GetMsgName(msg), wParam, lParam );
 
 	if( descr || msg == WM_CREATE )
         {
@@ -2534,8 +2534,8 @@
 	    {
 		case WM_CREATE:
 #define lpcs	((LPCREATESTRUCT32A)lParam)
-		     dprintf_info(combo, "\tpassed parent handle = 0x%08x\n", 
-					         (UINT32)lpcs->lpCreateParams);
+		     TRACE(combo, "\tpassed parent handle = 0x%08x\n", 
+				  (UINT32)lpcs->lpCreateParams);
 
 		     lphc = (LPHEADCOMBO)(lpcs->lpCreateParams);
 #undef  lpcs
@@ -2580,7 +2580,7 @@
         }
         lRet = DefWindowProc32A( hwnd, msg, wParam, lParam );
 
-        dprintf_info(combo,"\tComboLBox: default on msg [%04x]\n", (UINT16)msg );
+        TRACE(combo,"\t default on msg [%04x]\n", (UINT16)msg );
     }
 
     return lRet;
diff --git a/controls/menu.c b/controls/menu.c
index 24aecd4..12de09b 100644
--- a/controls/menu.c
+++ b/controls/menu.c
@@ -164,7 +164,7 @@
  */
 
 #define debug_print_menuitem(pre, mp, post) \
-  if(!debugging_info(menu)) ; else do_debug_print_menuitem(pre, mp, post)
+  if(!TRACE_ON(menu)) ; else do_debug_print_menuitem(pre, mp, post)
 
 #define MENUOUT(text) \
   dsprintf(menu, "%s%s", (count++ ? "," : ""), (text))
@@ -243,7 +243,7 @@
 	dsprintf(menu, "NULL");
     }
 
-    dprintf_info(menu, "%s %s %s\n", prefix, dbg_str(menu), postfix);
+    TRACE(menu, "%s %s %s\n", prefix, dbg_str(menu), postfix);
 }
 
 #undef MENUOUT
@@ -264,10 +264,10 @@
     }
     else {
 	hMenu = 0;
-	fprintf( stderr, "Unable to load default system menu\n" );
+	ERR(menu, "Unable to load default system menu\n" );
     }
 
-    dprintf_info(menu, "MENU_CopySysPopup: returning %x.\n", hMenu );
+    TRACE(menu, "returning %x.\n", hMenu );
 
     return hMenu;
 }
@@ -305,12 +305,12 @@
 	    menu = (POPUPMENU*) USER_HEAP_LIN_ADDR(hPopupMenu);
 	    menu->wFlags |= MF_SYSMENU;
 
-	    dprintf_info(menu,"GetSysMenu hMenu=%04x (%04x)\n", hMenu, hPopupMenu );
+	    TRACE(menu,"GetSysMenu hMenu=%04x (%04x)\n", hMenu, hPopupMenu );
 	    return hMenu;
 	}
 	DestroyMenu32( hMenu );
     }
-    fprintf(stderr, "failed to load system menu!\n");
+    ERR(menu, "failed to load system menu!\n");
     return 0;
 }
 
@@ -453,7 +453,7 @@
 	    break;
     }
 
-    dprintf_info(menu, "MENU_GetStartOfPrevColumn: ret %d.\n", i );
+    TRACE(menu, "ret %d.\n", i );
 
     return i;
 }
@@ -552,7 +552,7 @@
 static UINT32 MENU_FindItemByKey( HWND32 hwndOwner, HMENU32 hmenu, 
 				  UINT32 key, BOOL32 forceMenuChar )
 {
-    dprintf_info(menu,"\tlooking for '%c' in [%04x]\n", (char)key, (UINT16)hmenu );
+    TRACE(menu,"\tlooking for '%c' in [%04x]\n", (char)key, (UINT16)hmenu );
 
     if (!IsMenu32( hmenu )) 
     {
@@ -600,7 +600,7 @@
     DWORD dwSize;
     char *p;
 
-    dprintf_info(menu, "MENU_CalcItemSize: HDC 0x%x at (%d,%d)\n",
+    TRACE(menu, "HDC 0x%x at (%d,%d)\n",
                  hdc, orgX, orgY);
     debug_print_menuitem("MENU_CalcItemSize: menuitem:", lpitem, 
 			 (menuBar ? " (MenuBar)" : ""));
@@ -618,7 +618,7 @@
         SendMessage32A( hwndOwner, WM_MEASUREITEM, 0, (LPARAM)&mis );
         lpitem->rect.bottom += mis.itemHeight;
         lpitem->rect.right  += mis.itemWidth;
-        dprintf_info(menu, "MENU_CalcItemSize: %08x %dx%d\n",
+        TRACE(menu, "%08x %dx%d\n",
                      lpitem->wID, mis.itemWidth, mis.itemHeight);
         return;
     } 
@@ -753,7 +753,7 @@
 
     if ((lprect == NULL) || (lppop == NULL)) return;
     if (lppop->nItems == 0) return;
-    dprintf_info(menu,"MENU_MenuBarCalcSize left=%d top=%d right=%d bottom=%d\n", 
+    TRACE(menu,"MENU_MenuBarCalcSize left=%d top=%d right=%d bottom=%d\n", 
                  lprect->left, lprect->top, lprect->right, lprect->bottom);
     lppop->Width  = lprect->right - lprect->left;
     lppop->Height = 0;
@@ -773,9 +773,8 @@
 	    if ((i != start) &&
 		(lpitem->fType & (MF_MENUBREAK | MF_MENUBARBREAK))) break;
 
-	    dprintf_info(menu,
-			  "MENU_MenuBarCalcSize: calling MENU_CalcItemSize"
-			  " org=(%d, %d)\n", orgX, orgY );
+	    TRACE(menu, "calling MENU_CalcItemSize org=(%d, %d)\n", 
+			 orgX, orgY );
 	    debug_print_menuitem ("  item: ", lpitem, "");
 	    MENU_CalcItemSize( hdc, lpitem, hwndOwner, orgX, orgY, TRUE );
 	    if (lpitem->rect.right > lprect->right)
@@ -844,7 +843,7 @@
     {
         DRAWITEMSTRUCT32 dis;
 
-        dprintf_info(menu, "DrawMenuItem: Ownerdraw!\n" );
+        TRACE(menu, "Ownerdraw!\n" );
         dis.CtlType   = ODT_MENU;
         dis.itemID    = lpitem->wID;
         dis.itemData  = (DWORD)lpitem->text;
@@ -1137,7 +1136,7 @@
     
     lppop = (LPPOPUPMENU) USER_HEAP_LIN_ADDR( (HMENU16)wndPtr->wIDmenu );
     if (lppop == NULL || lprect == NULL) return SYSMETRICS_CYMENU;
-    dprintf_info(menu,"MENU_DrawMenuBar(%04x, %p, %p); !\n", 
+    TRACE(menu,"(%04x, %p, %p); !\n", 
 		 hDC, lprect, lppop);
     if (lppop->Height == 0) MENU_MenuBarCalcSize(hDC, lprect, lppop, hwnd);
     lprect->bottom = lprect->top + lppop->Height;
@@ -1172,7 +1171,7 @@
     {
 	HTASK16 hTask = 0;
 
-	dprintf_info(menu,"patching resident popup: %04x %04x [%04x %04x]\n", 
+	TRACE(menu,"patching resident popup: %04x %04x [%04x %04x]\n", 
 		checkQueue, checkWnd ? checkWnd->hwndSelf : 0, pTopPopupWnd->hmemTaskQ, 
 		pTopPopupWnd->owner ? pTopPopupWnd->owner->hwndSelf : 0);
 
@@ -1210,7 +1209,7 @@
 		pTopPopupWnd->hmemTaskQ = task->hQueue;
 		return TRUE;
 	    } 
-	    else dprintf_warn(menu,"failed to patch resident popup.\n");
+	    else WARN(menu,"failed to patch resident popup.\n");
 	} 
     }
     return FALSE;
@@ -1488,7 +1487,7 @@
 
     if (!(menu = (POPUPMENU *)USER_HEAP_LIN_ADDR(hMenu))) 
     {
-        dprintf_warn(menu, "MENU_InsertItem: %04x not a menu handle\n",
+        WARN(menu, "%04x not a menu handle\n",
                       hMenu );
         return NULL;
     }
@@ -1506,13 +1505,13 @@
     {
         if (!MENU_FindItem( &hMenu, &pos, flags )) 
         {
-            dprintf_warn(menu, "MENU_InsertItem: item %x not found\n",
+            WARN(menu, "item %x not found\n",
                           pos );
             return NULL;
         }
         if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu)))
         {
-            dprintf_warn(menu,"MENU_InsertItem: %04x not a menu handle\n",
+            WARN(menu,"%04x not a menu handle\n",
                          hMenu);
             return NULL;
         }
@@ -1523,7 +1522,7 @@
     newItems = HeapAlloc( SystemHeap, 0, sizeof(MENUITEM) * (menu->nItems+1) );
     if (!newItems)
     {
-        dprintf_warn(menu, "MENU_InsertItem: allocation failed\n" );
+        WARN(menu, "allocation failed\n" );
         return NULL;
     }
     if (menu->nItems > 0)
@@ -1562,8 +1561,7 @@
             res += sizeof(WORD);
         }
         if (!IS_STRING_ITEM(flags))
-            fprintf( stderr, "MENU_ParseResource: not a string item %04x\n",
-                     flags );
+            ERR(menu, "not a string item %04x\n", flags );
         str = res;
         if (!unicode) res += strlen(str) + 1;
         else res += (lstrlen32W((LPCWSTR)str) + 1) * sizeof(WCHAR);
@@ -1620,9 +1618,9 @@
 	{
 	    LPSTR newstr = HEAP_strdupWtoA(GetProcessHeap(),
 					   0, mii.dwTypeData);
-	    dprintf_info(menu, "Menu item: [%08x,%08x,%04x,%04x,%s]\n",
+	    TRACE(menu, "Menu item: [%08x,%08x,%04x,%04x,%s]\n",
 			 mii.fType, mii.fState, mii.wID, resinfo, newstr);
-	  HeapFree( GetProcessHeap(), 0, newstr );
+	    HeapFree( GetProcessHeap(), 0, newstr );
 	}
 
 	if (resinfo & 1) {	/* Pop-up? */
@@ -1834,7 +1832,7 @@
 
     item = &menu->items[menu->FocusedItem];
 
-    dprintf_info(menu, "MENU_ExecFocusedItem: %08x %08x %08x\n",
+    TRACE(menu, "%08x %08x %08x\n",
                  hMenu, item->wID, item->hSubMenu);
 
     if (!(item->fType & MF_POPUP))
@@ -1929,7 +1927,7 @@
 	    pmt->hCurrentMenu = MENU_ShowSubPopup( pmt->hOwnerWnd, hPtMenu, FALSE );
 	    return TRUE;
 	} 
-	else dprintf_warn(menu, "\tunable to find clicked item!\n");
+	else WARN(menu, "\tunable to find clicked item!\n");
     }
     return FALSE;
 }
@@ -2023,7 +2021,7 @@
 	LRESULT l = SendMessage16( pmt->hOwnerWnd, WM_NEXTMENU, (WPARAM16)vk, 
 		(IS_SYSTEM_MENU(menu)) ? GetSubMenu16(pmt->hTopMenu,0) : pmt->hTopMenu );
 
-	dprintf_info(menu,"NextMenu: %04x [%04x] -> %04x [%04x]\n",
+	TRACE(menu,"%04x [%04x] -> %04x [%04x]\n",
 		     (UINT16)pmt->hCurrentMenu, (UINT16)pmt->hOwnerWnd, LOWORD(l), HIWORD(l) );
 
 	if( l == 0 )
@@ -2071,7 +2069,7 @@
 		    /* FIXME: Not sure what to do here, perhaps,
 		     * try to track hNewMenu as a popup? */
 
-		    dprintf_info(menu,"MENU_DoNextMenu() got confused.\n");
+		    TRACE(menu," -- got confused.\n");
 		    return FALSE;
 		}
 	    }
@@ -2202,7 +2200,7 @@
     POPUPMENU *menu = (POPUPMENU *) USER_HEAP_LIN_ADDR( pmt->hTopMenu );
     UINT32  nextcol;
 
-    dprintf_info(menu, "MENU_KeyRight called, cur %x (%s), top %x (%s).\n",
+    TRACE(menu, "MENU_KeyRight called, cur %x (%s), top %x (%s).\n",
 		  pmt->hCurrentMenu,
 		  ((POPUPMENU *)USER_HEAP_LIN_ADDR(pmt->hCurrentMenu))->
 		     items[0].text,
@@ -2222,7 +2220,7 @@
     /* Check to see if there's another column */
     if( (nextcol = MENU_GetStartOfNextColumn( pmt->hCurrentMenu )) != 
 	NO_SELECTED_ITEM ) {
-	dprintf_info(menu, "KeyRight: Going to %d.\n", nextcol );
+	TRACE(menu, "Going to %d.\n", nextcol );
 	MENU_SelectItem( pmt->hOwnerWnd, pmt->hCurrentMenu,
 			 nextcol, TRUE );
 	return;
@@ -2565,7 +2563,7 @@
 BOOL32 WINAPI TrackPopupMenuEx( HMENU32 hMenu, UINT32 wFlags, INT32 x, INT32 y,
                                 HWND32 hWnd, LPTPMPARAMS lpTpm )
 {
-    fprintf( stderr, "TrackPopupMenuEx: not fully implemented\n" );
+    FIXME(menu, "not fully implemented\n" );
     return TrackPopupMenu32( hMenu, wFlags, x, y, 0, hWnd,
                              lpTpm ? &lpTpm->rcExclude : NULL );
 }
@@ -2611,7 +2609,7 @@
 
 	if( hwnd == pTopPopupWnd->hwndSelf )
 	{	
-	    dprintf_err(menu, "resident popup destroyed!\n");
+	    ERR(menu, "resident popup destroyed!\n");
 
 	    pTopPopupWnd = NULL; 
 	    uSubPWndLevel = 0; 
@@ -2625,7 +2623,7 @@
 	if( wParam )
 	{
 	    if( !(*(HMENU32*)wndPtr->wExtra) )
-		fprintf(stderr,"MenuWndProc: no menu to display\n");
+		ERR(menu,"no menu to display\n");
 	}
 	else
 	    *(HMENU32*)wndPtr->wExtra = 0;
@@ -2660,7 +2658,7 @@
     WND *wndPtr;
     LPPOPUPMENU lppop;
 
-    dprintf_info(menu, "MENU_GetMenuBarHeight: HWND 0x%x, width %d, "
+    TRACE(menu, "HWND 0x%x, width %d, "
 		  "at (%d, %d).\n", hwnd, menubarWidth, orgX, orgY );
     
     if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
@@ -2680,7 +2678,7 @@
 BOOL16 WINAPI ChangeMenu16( HMENU16 hMenu, UINT16 pos, SEGPTR data,
                             UINT16 id, UINT16 flags )
 {
-    dprintf_info(menu,"ChangeMenu16: menu=%04x pos=%d data=%08lx id=%04x flags=%04x\n",
+    TRACE(menu,"menu=%04x pos=%d data=%08lx id=%04x flags=%04x\n",
                   hMenu, pos, (DWORD)data, id, flags );
     if (flags & MF_APPEND) return AppendMenu16( hMenu, flags & ~MF_APPEND,
                                                 id, data );
@@ -2706,7 +2704,7 @@
 BOOL32 WINAPI ChangeMenu32A( HMENU32 hMenu, UINT32 pos, LPCSTR data,
                              UINT32 id, UINT32 flags )
 {
-    dprintf_info(menu,"ChangeMenu32A: menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n",
+    TRACE(menu,"menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n",
                   hMenu, pos, (DWORD)data, id, flags );
     if (flags & MF_APPEND) return AppendMenu32A( hMenu, flags & ~MF_APPEND,
                                                  id, data );
@@ -2727,7 +2725,7 @@
 BOOL32 WINAPI ChangeMenu32W( HMENU32 hMenu, UINT32 pos, LPCWSTR data,
                              UINT32 id, UINT32 flags )
 {
-    dprintf_info(menu,"ChangeMenu32W: menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n",
+    TRACE(menu,"menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n",
                   hMenu, pos, (DWORD)data, id, flags );
     if (flags & MF_APPEND) return AppendMenu32W( hMenu, flags & ~MF_APPEND,
                                                  id, data );
@@ -2759,7 +2757,7 @@
     MENUITEM *item;
     DWORD ret;
 
-    dprintf_info(menu,"CheckMenuItem: %04x %04x %04x\n", hMenu, id, flags );
+    TRACE(menu,"%04x %04x %04x\n", hMenu, id, flags );
     if (!(item = MENU_FindItem( &hMenu, &id, flags ))) return -1;
     ret = item->fState & MF_CHECKED;
     if (flags & MF_CHECKED) item->fState |= MF_CHECKED;
@@ -2785,8 +2783,8 @@
     BOOL32    bRet = FALSE;
     MENUITEM *item, *first = NULL;
 
-    dprintf_info(menu,"EnableMenuItem (%04x, %04X, %04X) !\n", 
-		                        hMenu, wItemID, wFlags);
+    TRACE(menu,"(%04x, %04X, %04X) !\n", 
+		 hMenu, wItemID, wFlags);
 
     while( (item = MENU_FindItem( &hMenu, &wItemID, wFlags )) )
     {
@@ -2833,14 +2831,14 @@
 {
     MENUITEM *item;
 
-    dprintf_info(menu, "GetMenuString32A: menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
+    TRACE(menu, "menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
                  hMenu, wItemID, str, nMaxSiz, wFlags );
     if (!str || !nMaxSiz) return 0;
     str[0] = '\0';
     if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0;
     if (!IS_STRING_ITEM(item->fType)) return 0;
     lstrcpyn32A( str, item->text, nMaxSiz );
-    dprintf_info(menu, "GetMenuString32A: returning '%s'\n", str );
+    TRACE(menu, "returning '%s'\n", str );
     return strlen(str);
 }
 
@@ -2853,7 +2851,7 @@
 {
     MENUITEM *item;
 
-    dprintf_info(menu, "GetMenuString32W: menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
+    TRACE(menu, "menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
                  hMenu, wItemID, str, nMaxSiz, wFlags );
     if (!str || !nMaxSiz) return 0;
     str[0] = '\0';
@@ -2881,7 +2879,7 @@
                                 UINT32 wHilite )
 {
     LPPOPUPMENU menu;
-    dprintf_info(menu,"HiliteMenuItem(%04x, %04x, %04x, %04x);\n", 
+    TRACE(menu,"(%04x, %04x, %04x, %04x);\n", 
                  hWnd, hMenu, wItemID, wHilite);
     if (!MENU_FindItem( &hMenu, &wItemID, wHilite )) return FALSE;
     if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return FALSE;
@@ -2907,7 +2905,7 @@
 UINT32 WINAPI GetMenuState32( HMENU32 hMenu, UINT32 wItemID, UINT32 wFlags )
 {
     MENUITEM *item;
-    dprintf_info(menu,"GetMenuState(%04x, %04x, %04x);\n", 
+    TRACE(menu,"(%04x, %04x, %04x);\n", 
 		 hMenu, wItemID, wFlags);
     if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return -1;
     debug_print_menuitem ("  item: ", item, "");
@@ -2934,7 +2932,7 @@
 {
     LPPOPUPMENU	menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu);
     if (!IS_A_MENU(menu)) return -1;
-    dprintf_info(menu,"GetMenuItemCount16(%04x) returning %d\n", 
+    TRACE(menu,"(%04x) returning %d\n", 
                   hMenu, menu->nItems );
     return menu->nItems;
 }
@@ -2947,7 +2945,7 @@
 {
     LPPOPUPMENU	menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu);
     if (!IS_A_MENU(menu)) return -1;
-    dprintf_info(menu,"GetMenuItemCount32(%04x) returning %d\n", 
+    TRACE(menu,"(%04x) returning %d\n", 
                   hMenu, menu->nItems );
     return menu->nItems;
 }
@@ -3004,10 +3002,10 @@
     MENUITEM *item;
 
     if (IS_STRING_ITEM(flags) && str)
-        dprintf_info(menu, "InsertMenu: hMenu %04x, pos %d, flags %08x, "
+        TRACE(menu, "hMenu %04x, pos %d, flags %08x, "
 		      "id %04x, str '%s'\n",
                       hMenu, pos, flags, id, str );
-    else dprintf_info(menu, "InsertMenu: hMenu %04x, pos %d, flags %08x, "
+    else TRACE(menu, "hMenu %04x, pos %d, flags %08x, "
 		       "id %04x, str %08lx (not a string)\n",
                        hMenu, pos, flags, id, (DWORD)str );
 
@@ -3093,7 +3091,7 @@
     LPPOPUPMENU	menu;
     MENUITEM *item;
 
-    dprintf_info(menu,"RemoveMenu (%04x, %04x, %04x)\n",hMenu, nPos, wFlags);
+    TRACE(menu,"(%04x, %04x, %04x)\n",hMenu, nPos, wFlags);
     if (!(item = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE;
     if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return FALSE;
     
@@ -3167,13 +3165,13 @@
 
     if (IS_STRING_ITEM(flags))
     {
-	dprintf_info(menu, "ModifyMenu: %04x %d %04x %04x '%s'\n",
+	TRACE(menu, "%04x %d %04x %04x '%s'\n",
                       hMenu, pos, flags, id, str ? str : "#NULL#" );
         if (!str) return FALSE;
     }
     else
     {
-	dprintf_info(menu, "ModifyMenu: %04x %d %04x %04x %08lx\n",
+	TRACE(menu, "%04x %d %04x %04x %08lx\n",
                       hMenu, pos, flags, id, (DWORD)str );
     }
 
@@ -3251,7 +3249,7 @@
                                     HBITMAP32 hNewUnCheck, HBITMAP32 hNewCheck)
 {
     MENUITEM *item;
-    dprintf_info(menu,"SetMenuItemBitmaps(%04x, %04x, %04x, %04x, %04x)\n",
+    TRACE(menu,"(%04x, %04x, %04x, %04x, %04x)\n",
                  hMenu, nPos, wFlags, hNewCheck, hNewUnCheck);
     if (!(item = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE;
 
@@ -3296,7 +3294,7 @@
     menu->hWnd   = 0;
     menu->items  = NULL;
     menu->FocusedItem = NO_SELECTED_ITEM;
-    dprintf_info(menu, "CreateMenu: return %04x\n", hMenu );
+    TRACE(menu, "return %04x\n", hMenu );
     return hMenu;
 }
 
@@ -3315,7 +3313,7 @@
  */
 BOOL32 WINAPI DestroyMenu32( HMENU32 hMenu )
 {
-    dprintf_info(menu,"DestroyMenu(%04x)\n", hMenu);
+    TRACE(menu,"(%04x)\n", hMenu);
 
     /* Silently ignore attempts to destroy default system popup */
 
@@ -3463,7 +3461,7 @@
 {
     WND * wndPtr = WIN_FindWndPtr(hWnd);
 
-    dprintf_info(menu,"SetMenu(%04x, %04x);\n", hWnd, hMenu);
+    TRACE(menu,"(%04x, %04x);\n", hWnd, hMenu);
 
     if (wndPtr && !(wndPtr->dwStyle & WS_CHILD))
     {
@@ -3575,11 +3573,11 @@
     if (HIWORD(name))
     {
         char *str = (char *)PTR_SEG_TO_LIN( name );
-        dprintf_info(menu, "LoadMenu(%04x,'%s')\n", instance, str );
+        TRACE(menu, "(%04x,'%s')\n", instance, str );
         if (str[0] == '#') name = (SEGPTR)atoi( str + 1 );
     }
     else
-        dprintf_info(resource,"LoadMenu(%04x,%04x)\n",instance,LOWORD(name));
+        TRACE(resource,"(%04x,%04x)\n",instance,LOWORD(name));
 
     if (!name) return 0;
     
@@ -3627,12 +3625,12 @@
     WORD version, offset;
     LPCSTR p = (LPCSTR)template;
 
-    dprintf_info(menu,"LoadMenuIndirect16: %p\n", template );
+    TRACE(menu,"(%p)\n", template );
     version = GET_WORD(p);
     p += sizeof(WORD);
     if (version)
     {
-        fprintf( stderr, "LoadMenuIndirect16: version must be 0 for Win16\n" );
+        WARN(menu, "version must be 0 for Win16\n" );
         return 0;
     }
     offset = GET_WORD(p);
@@ -3656,7 +3654,7 @@
     WORD version, offset;
     LPCSTR p = (LPCSTR)template;
 
-    dprintf_info(menu,"LoadMenuIndirect32A: %p\n", template );
+    TRACE(menu,"%p\n", template );
     version = GET_WORD(p);
     p += sizeof(WORD);
     switch (version)
@@ -3682,8 +3680,7 @@
 	  }
 	return hMenu;
       default:
-        fprintf( stderr, "LoadMenuIndirect32A: version %d not supported.\n",
-                 version );
+        ERR(menu, "version %d not supported.\n", version);
         return 0;
       }
 }
@@ -3867,8 +3864,8 @@
     MENUITEM *menu = MENU_FindItem(&hmenu, &item, bypos);
     if (!menu) return FALSE;
     debug_print_menuitem("SetMenuDefaultItem32: ", menu, "");
-    fprintf(stdnimp, "SetMenuDefaultItem32 (0x%x,%d,%d), empty stub!\n",
-	    hmenu, item, bypos);
+    FIXME(menu, "(0x%x,%d,%d), empty stub!\n",
+		  hmenu, item, bypos);
     return TRUE;
 }
 
@@ -3931,9 +3928,8 @@
      MENUITEM *mifirst, *milast, *micheck;
      HMENU32 mfirst = hMenu, mlast = hMenu, mcheck = hMenu;
 
-     dprintf_info(menu,
-		   "CheckMenuRadioItem32: ox%x: %d-%d, check %d, bypos=%d\n",
-		   hMenu, first, last, check, bypos);
+     TRACE(menu, "ox%x: %d-%d, check %d, bypos=%d\n",
+		  hMenu, first, last, check, bypos);
 
      mifirst = MENU_FindItem (&mfirst, &first, bypos);
      milast = MENU_FindItem (&mlast, &last, bypos);
@@ -3985,8 +3981,8 @@
      MENUITEM *item;
      HMENU32 orghMenu = hMenu;
 
-     dprintf_info(menu, "GetMenuItemRect32 (0x%x,0x%x,%d,%p)\n",
-		   hwnd, hMenu, uItem, rect);
+     TRACE(menu, "(0x%x,0x%x,%d,%p)\n",
+		  hwnd, hMenu, uItem, rect);
 
      item = MENU_FindItem (&hMenu, &uItem, MF_BYPOSITION);
      wndPtr = WIN_FindWndPtr (hwnd);
diff --git a/controls/progress.c b/controls/progress.c
index 426c2c4..38812a0 100644
--- a/controls/progress.c
+++ b/controls/progress.c
@@ -26,8 +26,8 @@
 
 /* Work constants */
 
-#define UNKNOWN_PARAM(msg, wParam, lParam) dprintf_warn(progress, \
-        "Progress Ctrl: Unknown parameter(s) for message " #msg     \
+#define UNKNOWN_PARAM(msg, wParam, lParam) WARN(progress, \
+        "Unknown parameter(s) for message " #msg     \
 	"(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam); 
 
 #define PROGRESS_GetInfoPtr(wndPtr) ((PROGRESS_INFO *)wndPtr->wExtra)
@@ -47,8 +47,8 @@
   RECT32 rect;
   HDC32 hdc;
 
-  dprintf_info(progress, "Progress Bar: paint pos=%d min=%d, max=%d\n",
-		   infoPtr->CurVal, infoPtr->MinVal, infoPtr->MaxVal);
+  TRACE(progress, "paint pos=%d min=%d, max=%d\n",
+	       infoPtr->CurVal, infoPtr->MinVal, infoPtr->MaxVal);
 
   /* get a dc */
   hdc = dc==0 ? BeginPaint32(wndPtr->hwndSelf, &ps) : dc;
@@ -114,11 +114,11 @@
       infoPtr->MaxVal=100;
       infoPtr->CurVal=0; 
       infoPtr->Step=10;
-      dprintf_info(updown, "Progress Ctrl creation, hwnd=%04x\n", hwnd);
+      TRACE(updown, "Progress Ctrl creation, hwnd=%04x\n", hwnd);
       break;
     
     case WM_DESTROY:
-      dprintf_info(updown, "Progress Ctrl destruction, hwnd=%04x\n", hwnd);
+      TRACE(updown, "Progress Ctrl destruction, hwnd=%04x\n", hwnd);
       break;
 
     case WM_ERASEBKGND:
@@ -194,8 +194,8 @@
     
     default: 
       if (message >= WM_USER) 
-	fprintf( stderr, "Progress Ctrl: unknown msg %04x wp=%04x lp=%08lx\n", 
-		 message, wParam, lParam );
+	ERR(progress, "unknown msg %04x wp=%04x lp=%08lx\n", 
+		    message, wParam, lParam );
       return DefWindowProc32A( hwnd, message, wParam, lParam ); 
     } 
 
diff --git a/controls/scroll.c b/controls/scroll.c
index 956f359..a3a533b 100644
--- a/controls/scroll.c
+++ b/controls/scroll.c
@@ -615,8 +615,8 @@
           return;  /* Should never happen */
     }
 
-    dprintf_info(scroll, "ScrollBar Event: hwnd=%04x bar=%d msg=%x pt=%d,%d hit=%d\n",
-                    hwnd, nBar, msg, pt.x, pt.y, hittest );
+    TRACE(scroll, "Event: hwnd=%04x bar=%d msg=%x pt=%d,%d hit=%d\n",
+		 hwnd, nBar, msg, pt.x, pt.y, hittest );
 
     switch(trackHitTest)
     {
@@ -766,8 +766,8 @@
 	    CREATESTRUCT32A *lpCreat = (CREATESTRUCT32A *)lParam;
             if (lpCreat->style & SBS_SIZEBOX)
             {
-                fprintf( stdnimp, "Unimplemented style SBS_SIZEBOX.\n" );
-                return 0;  /* FIXME */
+                FIXME(scroll, "Unimplemented style SBS_SIZEBOX.\n" );
+                return 0;
             }
             
 	    if (lpCreat->style & SBS_VERT)
@@ -794,7 +794,7 @@
             }
         }
         if (!hUpArrow) SCROLL_LoadBitmaps();
-        dprintf_info(scroll, "ScrollBar creation, hwnd=%04x\n", hwnd );
+        TRACE(scroll, "ScrollBar creation, hwnd=%04x\n", hwnd );
         return 0;
 	
     case WM_LBUTTONDOWN:
@@ -845,9 +845,7 @@
         return 0;  /* FIXME: return previous position */
 
     case SBM_GETRANGE16:
-        /* FIXME */
-        fprintf( stderr, "ScrollBar: don't know how to handle SBM_GETRANGE16 (wp=%04x,lp=%08lx)\n",
-                 wParam, lParam );
+        FIXME(scroll, "don't know how to handle SBM_GETRANGE16 (wp=%04x,lp=%08lx)\n", wParam, lParam );
         return 0;
 
     case SBM_GETRANGE32:
@@ -876,14 +874,14 @@
     case 0x00ed:
     case 0x00ee:
     case 0x00ef:
-        fprintf(stderr, "ScrollBar: unknown Win32 msg %04x wp=%08x lp=%08lx\n",
-                message, wParam, lParam );
+        ERR(scroll, "unknown Win32 msg %04x wp=%08x lp=%08lx\n",
+		    message, wParam, lParam );
         break;
 
     default:
         if (message >= WM_USER)
-            fprintf( stderr, "ScrollBar: unknown msg %04x wp=%04x lp=%08lx\n",
-                     message, wParam, lParam );
+            WARN(scroll, "unknown msg %04x wp=%04x lp=%08lx\n",
+			 message, wParam, lParam );
         return DefWindowProc32A( hwnd, message, wParam, lParam );
     }
     return 0;
@@ -952,7 +950,7 @@
         }
     }
 
-    dprintf_info(scroll, "SetScrollInfo: hwnd=%04x bar=%d %s\n", 
+    TRACE(scroll, "hwnd=%04x bar=%d %s\n", 
 		    hwnd, nBar, dbg_str(scroll));
 
     /* Make sure the page size is valid */
@@ -968,9 +966,9 @@
     else if (infoPtr->CurVal > infoPtr->MaxVal - MAX( infoPtr->Page-1, 0 ))
         infoPtr->CurVal = infoPtr->MaxVal - MAX( infoPtr->Page-1, 0 );
 
-    dprintf_info(scroll, "\n   new values: page=%d pos=%d min=%d max=%d\n",
-                    infoPtr->Page, infoPtr->CurVal,
-                    infoPtr->MinVal, infoPtr->MaxVal );
+    TRACE(scroll, "    new values: page=%d pos=%d min=%d max=%d\n",
+		 infoPtr->Page, infoPtr->CurVal,
+		 infoPtr->MinVal, infoPtr->MaxVal );
 
     /* Check if the scrollbar should be hidden or disabled */
 
@@ -1209,7 +1207,7 @@
     WND *wndPtr = WIN_FindWndPtr( hwnd );
 
     if (!wndPtr) return FALSE;
-    dprintf_info(scroll, "ShowScrollBar: hwnd=%04x bar=%d on=%d\n",
+    TRACE(scroll, "hwnd=%04x bar=%d on=%d\n",
                     hwnd, nBar, fShow );
 
     switch(nBar)
@@ -1285,7 +1283,7 @@
     SCROLLBAR_INFO *infoPtr;
 
     if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return FALSE;
-    dprintf_info(scroll, "EnableScrollBar: %04x %d %d\n",
+    TRACE(scroll, "%04x %d %d\n",
                     hwnd, nBar, flags );
     flags &= ESB_DISABLE_BOTH;
     if (infoPtr->flags == flags) return FALSE;
diff --git a/controls/static.c b/controls/static.c
index 9f1e680..e088d27 100644
--- a/controls/static.c
+++ b/controls/static.c
@@ -12,6 +12,7 @@
 #include "cursoricon.h"
 #include "static.h"
 #include "heap.h"
+#include "debug.h"
 
 static void STATIC_PaintTextfn( WND *wndPtr, HDC32 hdc );
 static void STATIC_PaintRectfn( WND *wndPtr, HDC32 hdc );
@@ -61,7 +62,7 @@
 
     if ((wndPtr->dwStyle & SS_TYPEMASK) != SS_ICON) return 0;
     if (hicon && !info) {
-	fprintf(stderr,"STATIC_SetIcon: huh? hicon!=0, but info=0???\n");
+	ERR(static, "huh? hicon!=0, but info=0???\n");
     	return 0;
     }
     prevIcon = infoPtr->hIcon;
@@ -88,7 +89,7 @@
 
     if ((wndPtr->dwStyle & SS_TYPEMASK) != SS_BITMAP) return 0;
     if (hicon && !info) {
-	fprintf(stderr,"STATIC_SetBitmap: huh? hicon!=0, but info=0???\n");
+	ERR(static, "huh? hicon!=0, but info=0???\n");
     	return 0;
     }
     prevIcon = infoPtr->hIcon;
@@ -184,7 +185,8 @@
             if (cs->lpszName)
                 STATIC_SetBitmap( wndPtr,
                                 STATIC_LoadBitmap( wndPtr, cs->lpszName ));
-	    fprintf(stderr,"STATIC:style SS_BITMAP, dwStyle is 0x%08lx\n",wndPtr->dwStyle);
+	    WARN(static, "style SS_BITMAP, dwStyle is 0x%08lx\n",
+			wndPtr->dwStyle);
             return 1;
 	}
         return DefWindowProc32A( hWnd, uMsg, wParam, lParam );
@@ -192,7 +194,7 @@
     case WM_CREATE:
         if (style < 0L || style > SS_TYPEMASK)
         {
-            fprintf( stderr, "STATIC: Unknown style 0x%02lx\n", style );
+            ERR(static, "Unknown style 0x%02lx\n", style );
             lResult = -1L;
             break;
         }
diff --git a/controls/uitools.c b/controls/uitools.c
index 8872a11..d3f814e 100644
--- a/controls/uitools.c
+++ b/controls/uitools.c
@@ -574,7 +574,7 @@
  */
 BOOL32 WINAPI DrawEdge32( HDC32 hdc, LPRECT32 rc, UINT32 edge, UINT32 flags )
 {
-    dprintf_info(graphics, "DrawEdge: %04x %d,%d-%d,%d %04x %04x\n",
+    TRACE(graphics, "%04x %d,%d-%d,%d %04x %04x\n",
                       hdc, rc->left, rc->top, rc->right, rc->bottom,
                       edge, flags );
 
@@ -941,7 +941,7 @@
         return UITOOLS_DFC_ButtonRadio(hdc, rc, uState);
 
     default:
-        fprintf(stdnimp, "UITOOLS_DrawFrameButton: Report this: Invalid button state: 0x%04x\n", uState);
+        WARN(uitools, "Invalid button state: 0x%04x\n", uState);
     }
 
     return FALSE;
@@ -1077,7 +1077,7 @@
         break;
 
     default:
-        fprintf(stdnimp, "UITOOLS_DrawFrameCaption: Report this: Invalid caption; flags: 0x%04x\n", uFlags);
+        WARN(uitools, "Invalid caption; flags: 0x%04x\n", uFlags);
         return FALSE;
     }
 
@@ -1247,7 +1247,7 @@
         return TRUE;
 
     default:
-        fprintf(stdnimp, "UITOOLS_DrawFrameScroll: Report this: Invalid scroll; flags: 0x%04x\n", uFlags);
+        WARN(uitools, "Invalid scroll; flags: 0x%04x\n", uFlags);
         return FALSE;
     }
 
@@ -1349,7 +1349,7 @@
         break;
 
     default:
-        fprintf(stdnimp, "UITOOLS_DrawFrameMenu: Report this: Invalid menu; flags: 0x%04x\n", uFlags);
+        WARN(uitools, "Invalid menu; flags: 0x%04x\n", uFlags);
         retval = FALSE;
         break;
     }
@@ -1397,8 +1397,8 @@
     case DFC_SCROLL:
       return UITOOLS_DrawFrameScroll(hdc, rc, uState);
     default:
-      fprintf( stdnimp,"DrawFrameControl32(%x,%p,%d,%x), bad type!\n",
-	       hdc,rc,uType,uState );
+      WARN(uitools, "(%x,%p,%d,%x), bad type!\n",
+		  hdc,rc,uType,uState );
     }
     return FALSE;
 }
diff --git a/controls/updown.c b/controls/updown.c
index 8a8302a..e3b95cb 100644
--- a/controls/updown.c
+++ b/controls/updown.c
@@ -60,7 +60,7 @@
 
 static int accelIndex = -1;
 
-#define UNKNOWN_PARAM(msg, wParam, lParam) dprintf_warn(updown, \
+#define UNKNOWN_PARAM(msg, wParam, lParam) WARN(updown, \
         "UpDown Ctrl: Unknown parameter(s) for message " #msg     \
 	"(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
 
@@ -207,8 +207,8 @@
     if(*src || !UPDOWN_InBounds(wndPtr, newVal)) 
       return FALSE;
 
-    dprintf_info(updown, "UpDown Ctrl: new value(%d) read from buddy "
-		   "(old=%d)\n",  newVal, infoPtr->CurVal);
+    TRACE(updown, "new value(%d) read from buddy (old=%d)\n", 
+		 newVal, infoPtr->CurVal);
   }
   
   infoPtr->CurVal = newVal;
@@ -232,8 +232,8 @@
   if (!IsWindow32(infoPtr->Buddy)) 
     return FALSE;
 
-  dprintf_info(updown, "UpDown Ctrl: set new value(%d) to buddy.\n",
-		 infoPtr->CurVal);
+  TRACE(updown, "set new value(%d) to buddy.\n",
+	       infoPtr->CurVal);
 
   /*if the buddy is a list window, we must set curr index */
   if(WIDGETS_IsControl32(WIN_FindWndPtr(infoPtr->Buddy), BIC32_LISTBOX)){
@@ -326,8 +326,7 @@
     return FALSE;
 
   if(wndPtr->dwStyle & UDS_ARROWKEYS){
-    /* FIXME: we need to subclass the buddy to process the arrow keys. */
-    fprintf(stderr, "UpDown Ctrl: we should subclass the buddy window!\n");
+    FIXME(updown, "we need to subclass the buddy to process the arrow keys.\n");
   }
 
   /* do we need to do any adjustments? */
@@ -379,8 +378,7 @@
   int old_val = infoPtr->CurVal;
   NM_UPDOWN ni;
 
-  dprintf_info(updown, "UpDown Ctrl action: %s by %d\n",
-		 incr ? "inc" : "dec", delta);
+  TRACE(updown, "%s by %d\n", incr ? "inc" : "dec", delta);
 
   /* check if we can do the modification first */
   delta *= (incr ? 1 : -1) * (infoPtr->MaxVal < infoPtr->MinVal ? -1 : 1);
@@ -548,8 +546,7 @@
       break;
 
       default:
-	fprintf(stderr, "UpDown: Impossible case in proc "
-		"UPDOWN_HandleMouseEvent");
+	ERR(updown, "Impossible case!\n");
     }
 
 }
@@ -581,13 +578,13 @@
       if(wndPtr->dwStyle & UDS_AUTOBUDDY)
 	UPDOWN_SetBuddy(wndPtr, GetWindow32(wndPtr->hwndSelf, GW_HWNDPREV));
 	
-      dprintf_info(updown, "UpDown Ctrl creation, hwnd=%04x\n", hwnd);
+      TRACE(updown, "UpDown Ctrl creation, hwnd=%04x\n", hwnd);
       break;
     
     case WM_DESTROY:
       if(infoPtr->AccelVect)
 	free(infoPtr->AccelVect);
-      dprintf_info(updown, "UpDown Ctrl destruction, hwnd=%04x\n", hwnd);
+      TRACE(updown, "UpDown Ctrl destruction, hwnd=%04x\n", hwnd);
       break;
 	
     case WM_ENABLE:
@@ -677,7 +674,7 @@
       return temp;
 
     case UDM_SETACCEL:
-      dprintf_info(updown, "UpDown Ctrl new accel info, hwnd=%04x\n", hwnd);
+      TRACE(updown, "UpDown Ctrl new accel info, hwnd=%04x\n", hwnd);
       if(infoPtr->AccelVect){
 	free(infoPtr->AccelVect);
 	infoPtr->AccelCount = 0;
@@ -697,7 +694,7 @@
       return infoPtr->Base;
 
     case UDM_SETBASE:
-      dprintf_info(updown, "UpDown Ctrl new base(%d), hwnd=%04x\n", 
+      TRACE(updown, "UpDown Ctrl new base(%d), hwnd=%04x\n", 
 		     wParam, hwnd);
       if ( !(wParam==10 || wParam==16) || lParam)
 	UNKNOWN_PARAM(UDM_SETBASE, wParam, lParam);
@@ -719,7 +716,7 @@
       temp = infoPtr->Buddy;
       infoPtr->Buddy = wParam;
       UPDOWN_SetBuddy(wndPtr, wParam);
-      dprintf_info(updown, "UpDown Ctrl new buddy(%04x), hwnd=%04x\n", 
+      TRACE(updown, "UpDown Ctrl new buddy(%04x), hwnd=%04x\n", 
 		     infoPtr->Buddy, hwnd);
       return temp;
 
@@ -733,7 +730,7 @@
       if (wParam || HIWORD(lParam))
 	UNKNOWN_PARAM(UDM_GETPOS, wParam, lParam);
       temp = SLOWORD(lParam);
-      dprintf_info(updown, "UpDown Ctrl new value(%d), hwnd=%04x\n",
+      TRACE(updown, "UpDown Ctrl new value(%d), hwnd=%04x\n",
 		     temp, hwnd);
       if(!UPDOWN_InBounds(wndPtr, temp)){
 	if(temp < infoPtr->MinVal)  
@@ -758,14 +755,14 @@
       infoPtr->MaxVal = SLOWORD(lParam); /* UD_MINVAL <= Max <= UD_MAXVAL */
       infoPtr->MinVal = SHIWORD(lParam); /* UD_MINVAL <= Min <= UD_MAXVAL */
                                          /* |Max-Min| <= UD_MAXVAL        */
-      dprintf_info(updown, "UpDown Ctrl new range(%d to %d), hwnd=%04x\n", 
+      TRACE(updown, "UpDown Ctrl new range(%d to %d), hwnd=%04x\n", 
 		     infoPtr->MinVal, infoPtr->MaxVal, hwnd);
       break;                             
 
     default: 
       if (message >= WM_USER) 
-	fprintf( stderr, "UpDown Ctrl: unknown msg %04x wp=%04x lp=%08lx\n", 
-		 message, wParam, lParam );
+	WARN(updown, "unknown msg %04x wp=%04x lp=%08lx\n", 
+		     message, wParam, lParam );
       return DefWindowProc32A( hwnd, message, wParam, lParam ); 
     } 
 
diff --git a/documentation/console b/documentation/console
index f6c71c6..e17cfa2 100644
--- a/documentation/console
+++ b/documentation/console
@@ -40,6 +40,7 @@
 FreeConsole is called on process exit (in ExitProcess) if 
 pdb->console is not NULL.
 
+
 BUGS
 ----
 Console processes do not inherit their parent's handles.  I think
@@ -47,6 +48,13 @@
 the stdin/stdout/stderr from unix, and one where they have to
 inherit from another windows app.
 
+SetConsoleMode -- UNIX only has ICANON and various ECHOs
+to play around with for processing input.  Win32 has
+line-at-a-time processing, character processing, and
+echo.  I'm putting together an intermediate driver
+that will handle this (and hopefully won't be any more
+buggy then the NT4 console implementation).
+
 
 ================================================================
 
@@ -80,3 +88,7 @@
 	o even when all the handles to it are freed, the win32 console
 	  stays visible, the only way I could find to free it
 	  was via the FreeConsole
+
+
+Is it possible to interrupt win32's FileWrite?  I'm not sure.
+It may not be possible to interrupt any system calls.
diff --git a/documentation/debug-msgs b/documentation/debug-msgs
index 3953a68..0813465 100644
--- a/documentation/debug-msgs
+++ b/documentation/debug-msgs
@@ -1,33 +1,35 @@
-Note: the debugging interface is under development. Please do not make
-      changes to it yet as I will do major changes in the next few weeks.
-      To make my life easier, PLEASE follow the guidelines described in
-      this document. If you have some ideas that you would like to
-      incorporate, please contact me first.
-      Please read the document before writing new code.
+Note: The new debugging interface is starting to take shape.
+      In general, I think it can be considered to be stable,
+      with the exception of the in-memory message construction functions.
+      However, there is still a lot of work to be done to polish
+      things up and to convert the remaining fprintf. To make my life 
+      easier, please follow the guidelines described in this document. 
+
+      Read this document before writing new code.
       Also, DO NOT USE fprintf (or printf) to output things. All these
-      will have to be translated to dprintf_ calls and there are already
+      will have to be translated to the new interface and there are already
       about 3000 of them! Also, instead of writing FIXMEs in the source,
-      output a dprintf_fixme message. But read on...
-25 Feb 1998, Dimitrie O. Paun <dimi@cs.toronto.edu>
+      output a FIXME message if you can. But read on...
+14 Mar 1998, Dimitrie O. Paun <dimi@cs.toronto.edu>
 
 
 Debugging classes
 -----------------
 
-The debugging messages are divided into 4 classes:
+There are 4 types (or classes) of debugging messages:
 
-fixme -- Messages in this class relate to behavior of Wine that does
+FIXME -- Messages in this class relate to behavior of Wine that does
          not correspond to standard Windows behavior and that should
          be fixed. 
          Examples: stubs, semi-implemented features, etc.
 
-err   -- Messages in this class relate to serious errors in Wine.
+ERR   -- Messages in this class relate to serious errors in Wine.
          This sort of messages are close to asserts -- that is,
-         you should output a 'err' message when the code detects a
+         you should output a error message when the code detects a
          condition which should not happen.
 	 Examples: unexpected change in internal state, etc.
 
-warn  -- This are warning messages. You should report a warning when
+WARN  -- These are warning messages. You should report a warning when
          something unwanted happen but the function behaves properly.
          That is, output a warning when you encounter something
          unexpected (ex: could not open a file) but the function deals
@@ -35,28 +37,24 @@
          If you do not deal correctly with it, output a fixme.
 	 Examples: fail to access a resource required by the app, etc.
 
-info  -- This are detailed debugging messages that are mainly useful 
-         to debug a component. This are usually turned off.
+TRACE -- These are detailed debugging messages that are mainly useful 
+         to debug a component. These are usually turned off.
          Examples: everything else that does not fall in one of the
                    above mentioned categories and the user does not
-                   need to know about it. This sort of messages simply
-                   outputs something about the state of some component 
-                   that is of interest mainly to the developer of that
-                   component.
-            
-We will refer to a generic class as yyy.
+                   need to know about it.
 
-The user has the capability to turn on or off messages in a particular
-class. You can expect the following patters of usage (but note that 
+            
+The user has the capability to turn on or off messages of a particular
+type. You can expect the following patterns of usage (but note that 
 any combination is possible):
-  -- when you debug a component, all classes (info,warn,err,fixme)
+  -- when you debug a component, all types (TRACE,WARN,ERR,FIXME)
      will be enabled.
   -- during the pre-alpha (maybe alpha) stage of Wine, most likely
-     the info class will be disabled by default, but all others
-     (warn,err,fixme) will be enabled by default.
-  -- when Wine will become stable, most likely the info and warn
-     classes will be disabled by default, but all err and fixme 
-     will be enabled by default.
+     the TRACE class will be disabled by default, but all others
+     (WARN,ERR,FIXME) will be enabled by default.
+  -- when Wine will become stable, most likely the TRACE and WARN
+     classes will be disabled by default, but all ERRs and FIXMEs 
+     will be enabled.
   -- in some installations that want the smallest footprint
      and where the debug information is of no interest, 
      all classes may be disabled by default.
@@ -70,11 +68,11 @@
 ------------------
 
 Also, we divide the debugging messages per component. Each component
-is assigned a debugging channel (or type). The identifier of the
+is assigned a debugging channel. The identifier of the
 channel must be a valid C identifier but note that it may also be a
 reserve word like int or static.
 
-Examples of debugging channels/types:
+Examples of debugging channels:
 reg, updown, string
 
 We will refer to a generic channel as xxx.
@@ -89,26 +87,28 @@
       In the new interface, we drop the stddeb as it is implicit.
       However, we add an orthogonal piece of information to the
       message: its class. This is very important as it will allow
-      us to selectively turn on or off certain messages based on
+      us to selectively turn on or off certain messages based on the
       type of information they report. For this reason it is VERY
       important to choose the right class for the message. 
       Anyhow, suppose we figured that this message should belong
-      in the warn class, so in the new interface, you write:
+      in the WARN class, so in the new interface, you write:
 
-      dprintf_warn(reg, "Could not access key!\n");
+      WARN(reg, "Could not access key!");
+
+      Notice the \n is no longer required.
 
 ---
 
 How to use it
 -------------
 
-So, to output a message (class yyy) on channel xxx, do:
+So, to output a message (class YYY) on channel xxx, do:
 
 #include "debug.h"
 
 ....
 
-dprintf_yyy(xxx, "<message>", ...);
+YYY(xxx, "<message>", ...);
 
 
 Some examples from the code:
@@ -117,14 +117,14 @@
 
 ...
 
-  dprintf_info(crtdll,
-	       "CRTDLL_setbuf(file %p buf %p)\n",
+  TRACE(crtdll, "CRTDLL_setbuf(file %p buf %p)",
 	       file, buf);
 
-  dprintf_warn(aspi, "Error opening device errno=%d\n", save_error);
+  WARN(aspi, "Error opening device errno=%d", save_error);
 
 
-If you need to declare a new debugging channel, do:
+If you need to declare a new debugging channel, use it in your code
+and then do:
 %tools/make_debug
 in the root directory of Wine.
 
@@ -132,20 +132,20 @@
 
 Notes:
    1. Please pay attention to which class you assign the message.
-      It is very, Very, VERY important to get the class right.
       There are only 4 classes, so it is not hard. The reason
       it is important to get it right is that too much information
       is no information. For example, if you put things into the 
-      warn class that should really be in the info class, the 
+      WARN class that should really be in the TRACE class, the 
       output will be too big and this will force the user to 
-      turn of warnings. But this way he will fail to see the important
-      ones. Also, if you put warnings into the info class lets say,
-      he will most likely miss those because usually the info class
+      turn warnings off. But this way he will fail to see the important
+      ones. Also, if you put warnings into the TRACE class lets say,
+      he will most likely miss those because usually the TRACE class
       is turned off. A similar argument can be made if you mix any
       other two classes.
-   2. ALL LINES MUST END WITH A NEWLINE!!! If you can NOT output
-      everything that you want in the line with only one dprintf_xxx
-      statement, then you need to build the string in memory.
+   2. All lines end by default with a newline. So you should not
+      add one more.  If you can NOT output everything that you want in 
+      the line with only one statement, then you need to build the string
+      in memory.
       Please read the section below "In-memory messages" on the
       preferred way to do it. PLEASE USE THAT INTERFACE TO BUILD
       MESSAGES IN MEMORY. The reason is that we are not sure that
@@ -158,17 +158,22 @@
 -----------------
 
 To test whether the debugging output of class yyy on channel xxx is
-enabled, do:
+enabled, use:
 
-debugging_yyy(xxx)
+TRACING  to test if TRACE is enabled
+WARNING  to test if WARN is enabled
+FIXMING  to test if FIXME is enabled
+ERRING   to test if ERR is enabled
 
 Examples:
 
-if(debugging_info(atom)){
+if(TRACING(atom)){
   ...blah...
 }
 
-
+Note that you should normaly need to test only if TRACING. At present,
+none of the other 3 tests (except for ERRING which is used only once!)
+are used in Wine.
 
 In-memory messages
 ------------------
@@ -204,11 +209,11 @@
 
   for (i = 0; i < descr->nb_tabs; i++) {
     descr->tabs[i] = *p++<<1; 
-    if(debugging_info(listbox))                  /* write in it only if
+    if(TRACING(listbox))                         /* write in it only if
       dsprintf(listbox, "%hd ", descr->tabs[i]); /* we are gonna output it */
   }
-  dprintf_info(listbox, "Listbox %04x: settabstops %s\n", 
-	       wnd->hwndSelf, dbg_str(listbox)); /* output the whole thing */
+  TRACE(listbox, "Listbox %04x: settabstops %s", 
+	wnd->hwndSelf, dbg_str(listbox));        /* output the whole thing */
 }
 
 If you need to use it two times in the same scope do like this:
@@ -221,21 +226,21 @@
 
   for (i = 0; i < descr->nb_tabs; i++) {
     descr->tabs[i] = *p++<<1;  
-    if(debugging_info(listbox))                  /* write in it only if
+    if(TRACING(listbox))                         /* write in it only if
       dsprintf(listbox, "%hd ", descr->tabs[i]); /* we are gonna output it */
   }
-  dprintf_info(listbox, "Listbox %04x: settabstops %s\n", 
-	       wnd->hwndSelf, dbg_str(listbox)); /* output the whole thing */
+  TRACE(listbox, "Listbox %04x: settabstops %s\n", 
+	wnd->hwndSelf, dbg_str(listbox));        /* output the whole thing */
 
   dbg_reset_str(listbox);                        /* !!!reset the string!!! */
   for (i = 0; i < descr->extrainfo_nr; i++) {
     descr->extrainfo = *p+1; 
-    if(debugging_info(listbox))                  /* write in it only if
+    if(TRACING(listbox))                         /* write in it only if
       dsprintf(listbox,"%3d ",descr->extrainfo); /* we are gonna output it */
   }
 
-  dprintf_info(listbox, "Listbox %04x: extrainfo %s\n", 
-	       wnd->hwndSelf, dbg_str(listbox)); /* output the whole thing */
+  TRACE(listbox, "Listbox %04x: extrainfo %s\n", 
+	wnd->hwndSelf, dbg_str(listbox));        /* output the whole thing */
 
 }
 
@@ -249,12 +254,12 @@
   interface (when it will become available). So, if you need to use if,
   then follow the following guidelines:
    -- wrap calls to dsprintf with a 
-      if(debugging_yyy(xxx))
+      if(YYY(xxx))
         dsprintf(xxx,...);
       Of course, if the call to dsprintf is made from within a function 
-      which you know is called only if debugging_yyy(xxx) is true
+      which you know is called only if YYY(xxx) is true
       (say you call it only like this:
-        if(debugging_yyy(xxx))
+        if(YYY(xxx))
           print_some_debug_info();
       )
       then you need not (and should not) wrap calls to dsprintf with
@@ -298,7 +303,7 @@
 
 ...
 
-   dprintf_yyy(xxx, "resource is %s", debugres(myresource));
+   YYY(xxx, "resource is %s", debugres(myresource));
 
 
 The -debugmsg command line option
@@ -316,15 +321,15 @@
    
     enables all messages on the reg channel and disables all
     messages on the file channel.
-    This is very close (actually identical) to the old semantics.
+    This is same as the old semantics.
 
   - when the optional class argument (yyy) is present, 
     then the statement will enable(+)/disable(-) messages for
     the given channel (xxx) only on the given class. For example:
    
-    -debugmsg info+reg,warn-file
+    -debugmsg trace+reg,warn-file
    
-    enables info messages on the reg channel and disables warning
+    enables trace messages on the reg channel and disables warning
     messages on the file channel.
 
   - also, the pseudo-channel all is also supported and it has the 
@@ -343,8 +348,8 @@
 
 
 Also, note that at the moment:
-   - the fixme, err, warn classes are all enabled by default
-   - the info class is disabled by default
+   - the fixme and err classes are enabled by default
+   - the trace and warn  classes are disabled by default
    - there is no way to compile out the messages. All are 
      runtime configurable. This will come next release.
 
diff --git a/documentation/status/lzexpand b/documentation/status/lzexpand
new file mode 100644
index 0000000..b89e354
--- /dev/null
+++ b/documentation/status/lzexpand
@@ -0,0 +1,20 @@
+This file contains information about the LZ file decompression libraries.
+
+The LZ (Lempel Ziv) decompression was used in win16 installation programs.
+(Win32 installation programs now use mostly CAB or WINZIP selfextractors 
+ or something similair.)
+It is a simple tabledriven decompression engine, the algorithm is not
+documented as far as I know. WINE does not contain a compressor for
+this format.
+
+The libraries consist of LZEXPAND.DLL (win16) and LZ32.DLL (win32), the 
+implementation can be found in misc/lzexpand.c and there is a small
+example program in libtest/expand.c.
+
+The implementation is complete and there have been no reports of failures
+for some time.
+
+FIXMEs:
+	- Check for correct include files
+	- Check whether the return values are correct
+	- Write a compressor for this format.
diff --git a/documentation/status/multimedia b/documentation/status/multimedia
new file mode 100644
index 0000000..04afca9
--- /dev/null
+++ b/documentation/status/multimedia
@@ -0,0 +1,176 @@
+This file contains information about the implementation of the multimedia
+layer of WINE.
+
+The libraries consist of MMSYSTEM.DLL (win16), WINMM.DLL (win32) and some
+(abstracted, not Windows compatible) lowlevel drivers. The implementation
+can be found in the multimedia/ subdirectory.
+
+The multimedia stuff is split into 3 layers. The lowlevel (device drivers),
+midlevel (MCI commands) and highlevel abstraction layers.
+
+1. Lowlevel layers
+
+   Following lowlevel layers are implemented:
+1.1 (Waveform) Audio
+
+   The API consists of the waveIn*/waveOut* functions found in
+   multimedia/mmsystem.c. They call the real lowlevel audiodriver using
+   the wodMessage/widMessage function in multimedia/audio.c, which handles
+   the different requests.
+
+   The lowlevel audio driver is currently only implemented for the
+   OpenSoundSystem (OSS) as supplied in the Linux and FreeBSD kernels by
+   4Front Technologies (http://www.4front-tech.com/). The presence of this
+   driver is checked by configure (depends on the <sys/soundcard.h> file).
+
+   The implementation contains all features commonly used, but has several
+   problems. For instance:
+      Writes and reads are not done asynchronously as they are supposed to
+   be done. This breaks some programs (soundrec.exe from the Windows applets),
+   but doesn't worry other programs. Some callbacks are probably done
+   incorrectly (there are reports of some broken multimedia applications,
+   but I haven't found one yet.)
+
+   TODO:
+   	- add asynchronous writes and reads (must use threads)
+	- check the callback functions
+	- verify all functions for correctness
+	- add drivers for other soundsystems (Sun Audio, remote audio systems
+	  (using X extensions, ...)
+
+1.2 Mixer
+
+   The API consists of the mixer* functions found in multimedia/mmsystem.c.
+   They call the lowlevel driver functions in multimedia/mixer.c using the
+   mixMessage function.
+
+   The current implementation tries to use the OpenSoundSystem mixer, but is
+   missing nearly everything. There is no report of a working application.
+   
+   TODO:
+   	- implement mixing functionality for OSS correctly.
+	- implement mixing lowlevel drivers for other mixers.
+
+1.3 MIDI
+	
+   The API consists of the midi* functions found in multimedia/mmsystem.c.
+   They call the lowlevel driver functions in multimedia/midi.c using the
+   midMessage and the modMessage functions.
+
+   The current implementation is completely broken. (I think open(), read()
+   and write() of the /dev/midi device would make this implementation nearly
+   complete...)
+
+   TODO:
+   	- Implement correct MIDI output
+	- Do not implement a software synthesizer. This should be done
+	  using MIDI loopback devices in an external program (like timidity).
+
+1.4 Timers
+
+   The API consists of the timer* functions found in multimedia/timer.c. 
+   There is currently only one implementation, which uses normal windows timers.
+   The implementation works for most cases found. The only problem is that
+   it doesn't support asynchronous timer events (as it is supposed to do).
+
+   There is a workaround for this lack in timeGetTime() to make Diablo work
+   and 'Pinball! SpaceCadet' at least start up.
+
+   TODO:
+   	- Implemented asynchronous timers (using a thread probably)
+
+1.5 MMIO
+   
+   The API consists of the mmio* functions found in multimedia/mmio.c.
+
+   FIXME: I am not sure about the status of this implementation.
+
+   TODO:
+   	- add win32 support.
+	- ...
+
+1.6 AUX
+   
+   The API consists of the aux* functions found in multimedia/mmsystem.c.
+   They call auxMessage in multimedia/mmaux.c.
+
+   The aux* functions are the predecessor of the mixer* functions.
+
+   The implementation uses the OSS mixer API, and is incomplete.
+
+   TODO:
+   	- verify the implementation
+
+1.7 JOYSTICK
+   
+   The API consists of the joy* functions found in multimedia/joystick.c.
+   The implementation currently uses the Linux joystick device driver API.
+   It is lacking support for enhanced joysticks and has not been extensively
+   tested.
+
+   TODO:
+   	- better support of enhanced joysticks
+	- support more joystick drivers (like the XInput extension)
+
+2. Midlevel drivers (MCI)
+   
+   The midlevel drivers are represented by some common API functions, 
+   mostly mciSendCommand and mciSendString. The mciSendString function
+   uses commandstrings, which are translated into normal MCI commands as
+   used by mciSendCommand. The API can be found in multimedia/mmsystem.c
+   and multimedia/mcistring.c.
+   The functions there (mciOpen,mciSysInfo) handle midlevel driver
+   allocation and calls.
+
+   The implementation is not complete, but works for most cases.
+   Win32 support for mciSendCommand is missing (mciSendString works
+   in the Win32 case, since the use of strings doesn't differ between
+   win16 and win32).
+
+   TODO:
+   	- Win32 support
+	- support windows MCI drivers (should be possible for they usually 
+	  do not use lowlevel calls)
+	- MCI command loading support
+	- implement other stuff as yet unknown
+
+   WINE implements several MCI midlevel drivers:
+
+2.1 CDAUDIO
+   
+   The currently best implementation is the MCI CDAUDIO driver that can
+   be found in multimedia/mcicda.c. The implementation is mostly complete,
+   there have been no reports of errors.
+   The implementation currently uses only the Linux /dev/cdrom controlling
+   functions. (Sun and BSD like should be similair, but are not implemented.)
+
+   A very small example of a cdplayer consists just of the line
+   mciSendString("play cdaudio",NULL,0,0);
+
+   TODO:
+   	- add support for other cdaudio drivers
+
+2.2 MCIWAVE
+   
+   The implementation is rather complete and can be found in multimedia/audio.c.
+   It uses the lowlevel audio API (although not abstracted correctly).
+   FIXME: The MCI_STATUS command is broken.
+
+   TODO: - check for correctness
+
+2.3 MIDI/SEQUENCER
+   
+   The implementation can be found in multimedia/midi.c. I am not sure
+   about the completeness.
+   It uses the lowlevel midi driver and is probably broken too.
+
+   TODO: 
+   	- implement it correctly
+
+2.4 MCIANIM
+
+   The implementation consists of stubs and is in multimedia/mcianim.c.
+
+   TODO: 
+   	- implement it, probably using xanim or something similair. Could
+	  also be implemented by using the Windows MCI video drivers.
diff --git a/documentation/status/version b/documentation/status/version
new file mode 100644
index 0000000..3c8704f
--- /dev/null
+++ b/documentation/status/version
@@ -0,0 +1,20 @@
+This file contains information about the versioning libraries.
+They consist of VER.DLL (win16) and VERSION.DLL (win32).
+The implementation can be found in misc/ver.c.
+
+The purpose of this library is to:
+	- Extract resource information from possibly compressed files
+	- Install dlls including versionchecking
+	- Query version dependend variables.
+
+The resource extraction is almost complete. There have been no reports of
+missing functionality, but I am not sure about absolute completeness. 
+
+The DLL installation APIs do work, but is probably not correct.
+
+The API to query version dependend variables (VerQueryValue) works for
+both win16/win32 resources, but is probably not correct for some cases.
+
+FIXME:
+	- Check the installation functions.
+	- Verify VerQueryValue.
diff --git a/files/directory.c b/files/directory.c
index dafec96..8ab2720 100644
--- a/files/directory.c
+++ b/files/directory.c
@@ -96,10 +96,10 @@
         DIR_PathElements++;
     }
 
-    if (debugging_info(dosfs))
+    if (TRACE_ON(dosfs))
         for (i = 0; i < DIR_PathElements; i++)
         {
-            dprintf_info(dosfs, "Path[%d]: %s = %s\n",
+            TRACE(dosfs, "Path[%d]: %s = %s\n",
                            i, DIR_DosPath[i], DIR_UnixPath[i] );
         }
 }
@@ -155,10 +155,11 @@
                              path, sizeof(path) );
     DIR_ParseWindowsPath( path );
 
-    dprintf_info(dosfs, "WindowsDir = %s\nSystemDir  = %s\n",
-                   DIR_WindowsDosDir, DIR_SystemDosDir );
-    dprintf_info(dosfs, "TempDir    = %s\nCwd        = %c:\\%s\n",
-                   DIR_TempDosDir, 'A' + drive, DRIVE_GetDosCwd( drive ) );
+    TRACE(dosfs, "WindowsDir = %s\n", DIR_WindowsDosDir);
+    TRACE(dosfs, "SystemDir  = %s\n", DIR_SystemDosDir);
+    TRACE(dosfs, "TempDir    = %s\n", DIR_TempDosDir);
+    TRACE(dosfs, "Cwd        = %c:\\%s\n",
+		 'A' + drive, DRIVE_GetDosCwd( drive ) );
 
     /* Put the temp and Windows and system directories into the environment */
 
@@ -327,7 +328,7 @@
  */
 BOOL16 WINAPI CreateDirectory16( LPCSTR path, LPVOID dummy )
 {
-    dprintf_info(file,"CreateDirectory16(%s,%p)\n", path, dummy );
+    TRACE(file,"(%s,%p)\n", path, dummy );
     return (BOOL16)CreateDirectory32A( path, NULL );
 }
 
@@ -340,10 +341,10 @@
 {
     DOS_FULL_NAME full_name;
 
-    dprintf_info(file, "CreateDirectory32A(%s,%p)\n", path, lpsecattribs );
+    TRACE(file, "(%s,%p)\n", path, lpsecattribs );
     if (DOSFS_IsDevice( path ))
     {
-        dprintf_info(file, "CreateDirectory: cannot use device '%s'!\n",path);
+        TRACE(file, "cannot use device '%s'!\n",path);
         DOS_ERROR( ER_AccessDenied, EC_AccessDenied, SA_Abort, EL_Disk );
         return FALSE;
     }
@@ -406,11 +407,11 @@
 {
     DOS_FULL_NAME full_name;
 
-    dprintf_info(file, "RemoveDirectory: '%s'\n", path );
+    TRACE(file, "'%s'\n", path );
 
     if (DOSFS_IsDevice( path ))
     {
-        dprintf_info(file, "RemoveDirectory: cannot remove device '%s'!\n", path);
+        TRACE(file, "cannot remove device '%s'!\n", path);
         DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk );
         return FALSE;
     }
diff --git a/files/dos_fs.c b/files/dos_fs.c
index 416c5c0..8ca3fb9 100644
--- a/files/dos_fs.c
+++ b/files/dos_fs.c
@@ -500,13 +500,13 @@
     if ((p = strchr( name, '\\' ))) len = MIN( (int)(p - name), len );
     if (long_len < len + 1) return FALSE;
 
-    dprintf_info(dosfs, "DOSFS_FindUnixName: %s,%s\n", path, name );
+    TRACE(dosfs, "%s,%s\n", path, name );
 
     if (!DOSFS_ToDosFCBFormat( name, dos_name )) dos_name[0] = '\0';
 
     if (!(dir = DOSFS_OpenDir( path )))
     {
-        dprintf_warn(dosfs, "DOSFS_FindUnixName(%s,%s): can't open dir: %s\n",
+        WARN(dosfs, "(%s,%s): can't open dir: %s\n",
                        path, name, strerror(errno) );
         return FALSE;
     }
@@ -546,11 +546,11 @@
             else
                 DOSFS_Hash( long_name, short_buf, FALSE, ignore_case );
         }
-        dprintf_info(dosfs, "(%s,%s) -> %s (%s)\n",
+        TRACE(dosfs, "(%s,%s) -> %s (%s)\n",
 		     path, name, long_name, short_buf ? short_buf : "***");
     }
     else
-        dprintf_warn(dosfs, "file: '%s' NOT FOUND in dir: '%s'\n", name, path);
+        WARN(dosfs, "'%s' not found in '%s'\n", name, path);
     DOSFS_CloseDir( dir );
     return ret;
 }
@@ -613,7 +613,7 @@
 				return GetStdHandle( STD_OUTPUT_HANDLE );
 				break;
 			default:
-				fprintf(stderr,"DOSFS_OpenDevice: CON cannot be opened read/write currently, FIXME.\n");
+				FIXME(dosfs,"can't open CON read/write\n");
 				return HFILE_ERROR32;
 				break;
 			}
@@ -679,7 +679,7 @@
     UINT32 flags;
     char *p_l, *p_s, *root;
 
-    dprintf_info(dosfs, "DOSFS_GetFullName: %s (last=%d)\n",
+    TRACE(dosfs, "%s (last=%d)\n",
                    name, check_last );
 
     if ((full->drive = DOSFS_GetPathDrive( &name )) == -1) return FALSE;
@@ -787,7 +787,7 @@
     }
     if (!full->long_name[0]) strcpy( full->long_name, "/" );
     if (!full->short_name[2]) strcpy( full->short_name + 2, "\\" );
-    dprintf_info(dosfs, "DOSFS_GetFullName: returning %s = %s\n",
+    TRACE(dosfs, "returning %s = %s\n",
                    full->long_name, full->short_name );
     return TRUE;
 }
@@ -877,7 +877,7 @@
     int drive;
     char *p;
 
-    dprintf_info(dosfs, "GetFullPathName: converting %s\n", name );
+    TRACE(dosfs, "converting %s\n", name );
 
     if (!name || !result) return 0;
 
@@ -941,7 +941,7 @@
     if (unicode) lstrcpynAtoW( (LPWSTR)result, buffer, len );
     else lstrcpyn32A( result, buffer, len );
 
-    dprintf_info(dosfs, "GetFullPathName: returning %s\n", buffer );
+    TRACE(dosfs, "returning %s\n", buffer );
     return strlen(buffer);
 }
 
@@ -1026,7 +1026,7 @@
     else  /* Not in the cache, open it anew */
     {
         const char *drive_path;
-        dprintf_info(dosfs, "DOSFS_FindNext: cache miss, path=%s skip=%d buf=%s cur=%d\n",
+        TRACE(dosfs, "cache miss, path=%s skip=%d buf=%s cur=%d\n",
                        path, skip, buffer, cur_pos );
         cur_pos = skip;
         if (dir) DOSFS_CloseDir(dir);
@@ -1035,7 +1035,7 @@
         drive_path = path + strlen(DRIVE_GetRoot(drive));
         while ((*drive_path == '/') || (*drive_path == '\\')) drive_path++;
         drive_root = !*drive_path;
-        dprintf_info(dosfs, "DOSFS_FindNext: drive_root = %d\n", drive_root);
+        TRACE(dosfs, "drive_root = %d\n", drive_root);
         lstrcpyn32A( buffer, path, sizeof(buffer) - 1 );
     }
     strcat( buffer, "/" );
@@ -1079,7 +1079,7 @@
         lstrcpyn32A( p, long_name, sizeof(buffer) - (int)(p - buffer) );
         if (!FILE_Stat( buffer, &info ))
         {
-            fprintf( stderr, "DOSFS_FindNext: can't stat %s\n", buffer );
+            WARN(dosfs, "can't stat %s\n", buffer);
             continue;
         }
         if (info.dwFileAttributes & ~attr) continue;
@@ -1101,7 +1101,7 @@
 
         lstrcpyn32A( entry->cFileName, long_name, sizeof(entry->cFileName) );
         if (!(flags & DRIVE_CASE_PRESERVING)) CharLower32A( entry->cFileName );
-        dprintf_info(dosfs, "DOSFS_FindNext: returning %s (%s) %02lx %ld\n",
+        TRACE(dosfs, "returning %s (%s) %02lx %ld\n",
                        entry->cFileName, entry->cAlternateFileName,
                        entry->dwFileAttributes, entry->nFileSizeLow );
         cur_pos += count;
@@ -1547,13 +1547,26 @@
 BOOL32 WINAPI FileTimeToLocalFileTime( const FILETIME *utcft,
                                        LPFILETIME localft )
 {
-    struct tm *xtm;
     DWORD remainder;
-
     /* convert from UTC to local. Perhaps not correct. FIXME */
     time_t unixtime = DOSFS_FileTimeToUnixTime( utcft, &remainder );
+#ifdef HAVE_TIMEGM
+    struct tm *xtm = localtime( &unixtime );
+    time_t localtime;
+
+    localtime = timegm(xtm);
+    DOSFS_UnixTimeToFileTime( localtime, localft, remainder );
+
+#else
+    struct tm *xtm,*gtm;
+    time_t time1,time2;
+
     xtm = localtime( &unixtime );
-    DOSFS_UnixTimeToFileTime( mktime(xtm), localft, remainder );
+    gtm = gmtime( &unixtime );
+    time1 = mktime(xtm);
+    time2 = mktime(gtm);
+    DOSFS_UnixTimeToFileTime( 2*time1-time2, localft, remainder );
+#endif
     return TRUE; 
 }
 
@@ -1567,7 +1580,7 @@
     DWORD remainder;
     time_t xtime = DOSFS_FileTimeToUnixTime( ft, &remainder );
     xtm = gmtime(&xtime);
-    syst->wYear         = xtm->tm_year;
+    syst->wYear         = xtm->tm_year+1900;
     syst->wMonth        = xtm->tm_mon + 1;
     syst->wDayOfWeek    = xtm->tm_wday;
     syst->wDay	        = xtm->tm_mday;
@@ -1588,7 +1601,7 @@
     LPSTR s;
     char  buffer[200];
 
-    dprintf_info(dosfs,"QueryDosDevice(%s,...)\n",devname?devname:"<null>");
+    TRACE(dosfs,"(%s,...)\n",devname?devname:"<null>");
     if (!devname) {
 	/* return known MSDOS devices */
 	lstrcpy32A(buffer,"CON COM1 COM2 LPT1 NUL ");
@@ -1629,15 +1642,33 @@
  */
 BOOL32 WINAPI SystemTimeToFileTime( const SYSTEMTIME *syst, LPFILETIME ft )
 {
+#ifdef HAVE_TIMEGM
     struct tm xtm;
+    time_t utctime;
+#else
+    struct tm xtm,*local_tm,*utc_tm;
+    time_t localtim,utctime;
+#endif
 
-    xtm.tm_year	= syst->wYear;
+    xtm.tm_year	= syst->wYear-1900;
     xtm.tm_mon	= syst->wMonth - 1;
     xtm.tm_wday	= syst->wDayOfWeek;
     xtm.tm_mday	= syst->wDay;
     xtm.tm_hour	= syst->wHour;
     xtm.tm_min	= syst->wMinute;
-    xtm.tm_sec	= syst->wSecond;
-    DOSFS_UnixTimeToFileTime( mktime(&xtm), ft, syst->wMilliseconds * 10000 );
+    xtm.tm_sec	= syst->wSecond; /* this is UTC */
+    xtm.tm_isdst = -1;
+#ifdef HAVE_TIMEGM
+    utctime = timegm(&xtm);
+    DOSFS_UnixTimeToFileTime( utctime, ft, 
+			      syst->wMilliseconds * 10000 );
+#else
+    localtim = mktime(&xtm);    /* now we've got local time */
+    local_tm = localtime(&localtim);
+    utc_tm = gmtime(&localtim);
+    utctime = mktime(utc_tm);
+    DOSFS_UnixTimeToFileTime( 2*localtim -utctime, ft, 
+			      syst->wMilliseconds * 10000 );
+#endif
     return TRUE; 
 }
diff --git a/files/drive.c b/files/drive.c
index 35266cd..68dfeb6 100644
--- a/files/drive.c
+++ b/files/drive.c
@@ -193,12 +193,12 @@
                 DRIVE_CurDrive = i;
 
             count++;
-            dprintf_info(dosfs, "%s: path=%s type=%s label='%s' serial=%08lx flags=%08x dev=%x ino=%x\n",
+            TRACE(dosfs, "%s: path=%s type=%s label='%s' serial=%08lx flags=%08x dev=%x ino=%x\n",
                            name, path, DRIVE_Types[drive->type],
                            drive->label, drive->serial, drive->flags,
                            (int)drive->dev, (int)drive->ino );
         }
-        else dprintf_warn(dosfs, "%s: not defined\n", name );
+        else WARN(dosfs, "%s: not defined\n", name );
     }
 
     if (!count) 
@@ -265,7 +265,7 @@
         DOS_ERROR( ER_InvalidDrive, EC_MediaError, SA_Abort, EL_Disk );
         return 0;
     }
-    dprintf_info(dosfs, "DRIVE_SetCurrentDrive: %c:\n", 'A' + drive );
+    TRACE(dosfs, "%c:\n", 'A' + drive );
     DRIVE_CurDrive = drive;
     if (pTask) pTask->curdrive = drive | 0x80;
     return 1;
@@ -325,7 +325,7 @@
     *next = 0;
 
     if (rootdrive != -1)
-        dprintf_info(dosfs, "DRIVE_FindDriveRoot: %s -> drive %c:, root='%s', name='%s'\n",
+        TRACE(dosfs, "%s -> drive %c:, root='%s', name='%s'\n",
                        buffer, 'A' + rootdrive,
                        DOSDrives[rootdrive].root, *path );
     return rootdrive;
@@ -446,7 +446,7 @@
     BY_HANDLE_FILE_INFORMATION info;
     TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
 
-    dprintf_info(dosfs, "DRIVE_Chdir(%c:,%s)\n", 'A' + drive, path );
+    TRACE(dosfs, "(%c:,%s)\n", 'A' + drive, path );
     strcpy( buffer, "A:" );
     buffer[0] += drive;
     lstrcpyn32A( buffer + 2, path, sizeof(buffer) - 2 );
@@ -461,7 +461,7 @@
     unix_cwd = full_name.long_name + strlen( DOSDrives[drive].root );
     while (*unix_cwd == '/') unix_cwd++;
 
-    dprintf_info(dosfs, "DRIVE_Chdir(%c:): unix_cwd=%s dos_cwd=%s\n",
+    TRACE(dosfs, "(%c:): unix_cwd=%s dos_cwd=%s\n",
                    'A' + drive, unix_cwd, full_name.short_name + 3 );
 
     HeapFree( SystemHeap, 0, DOSDrives[drive].dos_cwd );
@@ -534,7 +534,7 @@
 
     if ( new->root )
     {
-        dprintf_info(dosfs, "Can\'t map drive %c to drive %c - "
+        TRACE(dosfs, "Can\'t map drive %c to drive %c - "
 	                        "drive %c already exists\n",
 			'A' + existing_drive, 'A' + new_drive,
 			'A' + new_drive );
@@ -551,7 +551,7 @@
     new->dev = old->dev;
     new->ino = old->ino;
 
-    dprintf_info(dosfs, "Drive %c is now equal to drive %c\n",
+    TRACE(dosfs, "Drive %c is now equal to drive %c\n",
                     'A' + new_drive, 'A' + existing_drive );
 
     return 1;
@@ -734,7 +734,7 @@
  */
 UINT16 WINAPI GetDriveType16( UINT16 drive )
 {
-    dprintf_info(dosfs, "GetDriveType16(%c:)\n", 'A' + drive );
+    TRACE(dosfs, "(%c:)\n", 'A' + drive );
     switch(DRIVE_GetType(drive))
     {
     case TYPE_FLOPPY:  return DRIVE_REMOVABLE;
@@ -752,7 +752,7 @@
  */
 UINT32 WINAPI GetDriveType32A( LPCSTR root )
 {
-    dprintf_info(dosfs, "GetDriveType32A(%s)\n", root );
+    TRACE(dosfs, "(%s)\n", root );
     if ((root[1]) && (root[1] != ':'))
     {
         fprintf( stderr, "GetDriveType32A: invalid root '%s'\n", root );
diff --git a/files/file.c b/files/file.c
index e1de218..1d6b97e 100644
--- a/files/file.c
+++ b/files/file.c
@@ -104,7 +104,7 @@
 	FILE_OBJECT *file = (FILE_OBJECT *)ptr;
 	int result;
 
-	dprintf_info(file, "FILE_Read: %p %p %ld\n", ptr, lpBuffer,
+	TRACE(file, "%p %p %ld\n", ptr, lpBuffer,
                      nNumberOfChars);
 
 	if (nNumberOfChars == 0) {
@@ -134,15 +134,14 @@
 	FILE_OBJECT *file = (FILE_OBJECT *)ptr;
 	int result;
 
-	dprintf_info(file, "FILE_Write: %p %p %ld\n", ptr, lpBuffer,
+	TRACE(file, "%p %p %ld\n", ptr, lpBuffer,
 		      nNumberOfChars);
 
 	*lpNumberOfChars = 0; 
 
-	/* FIXME: there was a loop here before that 
-	 * retried writes after EAGAIN, why??? -- I assume
-	 * it is because win32 doesn't have interrupted
-	 * system calls 
+	/* 
+	 * I assume this loop around EAGAIN is here because
+	 * win32 doesn't have interrupted system calls 
 	 */
 
 	for (;;)
@@ -229,7 +228,7 @@
 {
     int save_errno = errno; /* errno gets overwritten by printf */
 
-    dprintf_info(file, "FILE_SetDosError: errno = %d %s\n", errno, strerror(errno));
+    TRACE(file, "errno = %d %s\n", errno, strerror(errno));
     switch (save_errno)
     {
     case EAGAIN:
@@ -263,6 +262,7 @@
         DOS_ERROR( ER_FileExists, EC_Exists, SA_Abort, EL_Disk );
         break;
     case EINVAL:
+    case ESPIPE:
         DOS_ERROR( ER_SeekError, EC_NotFound, SA_Ignore, EL_Disk );
         break;
     case ENOTEMPTY:
@@ -345,7 +345,7 @@
     DOS_FULL_NAME full_name;
     const char *unixName;
 
-    dprintf_info(file, "FILE_Open: '%s' %04x\n", path, mode );
+    TRACE(file, "'%s' %04x\n", path, mode );
 
     if (!path) return HFILE_ERROR32;
 
@@ -353,7 +353,7 @@
     {
     	HFILE32	ret;
 
-        dprintf_info(file, "FILE_Open: opening device '%s'\n", path );
+        TRACE(file, "opening device '%s'\n", path );
 
 	if (HFILE_ERROR32!=(ret=DOSFS_OpenDevice( path, mode )))
 		return ret;
@@ -383,7 +383,7 @@
     FILE_OBJECT *file;
     DOS_FULL_NAME full_name;
 
-    dprintf_info(file, "FILE_Create: '%s' %04x %d\n", path, mode, unique );
+    TRACE(file, "'%s' %04x %d\n", path, mode, unique );
 
     if (!path) return INVALID_HANDLE_VALUE32;
 
@@ -582,11 +582,11 @@
     FILE_OBJECT *file;
     HFILE32 handle;
 
-    dprintf_info(file, "FILE_Dup for handle %d\n", hFile );
+    TRACE(file, "FILE_Dup for handle %d\n", hFile );
     if (!(file = FILE_GetFile( hFile ))) return HFILE_ERROR32;
     handle = HANDLE_Alloc( &file->header, FILE_ALL_ACCESS /*FIXME*/, FALSE );
     FILE_ReleaseFile( file );
-    dprintf_info(file, "FILE_Dup return handle %d\n", handle );
+    TRACE(file, "FILE_Dup return handle %d\n", handle );
     return handle;
 }
 
@@ -600,7 +600,7 @@
 {
     FILE_OBJECT *file;
 
-    dprintf_info(file, "FILE_Dup2 for handle %d\n", hFile1 );
+    TRACE(file, "FILE_Dup2 for handle %d\n", hFile1 );
     /* FIXME: should use DuplicateHandle */
     if (!(file = FILE_GetFile( hFile1 ))) return HFILE_ERROR32;
     if (!HANDLE_SetObjPtr( hFile2, &file->header, 0 )) hFile2 = HFILE_ERROR32;
@@ -672,7 +672,7 @@
             HFILE32 handle = FILE_Create( buffer, 0666, TRUE );
             if (handle != INVALID_HANDLE_VALUE32)
             {  /* We created it */
-                dprintf_info(file, "GetTempFileName32A: created %s\n",
+                TRACE(file, "created %s\n",
 			      buffer);
                 CloseHandle( handle );
                 break;
@@ -696,7 +696,7 @@
                      "Please check your configuration file if this generates a failure.\n",
                      buffer);
     }
-    dprintf_info(file, "GetTempFileName32A: returning %s\n", buffer );
+    TRACE(file, "returning %s\n", buffer );
     return unique ? unique : num;
 }
 
@@ -750,7 +750,7 @@
 	return HFILE_ERROR32;
     }
 
-    dprintf_info(file, "OpenFile: %s %04x\n", name, mode );
+    TRACE(file, "%s %04x\n", name, mode );
 
     /* the watcom 10.6 IDE relies on a valid path returned in ofs->szPathName
        Are there any cases where getting the path here is wrong? 
@@ -764,7 +764,7 @@
     {
         ofs->fFixedDisk = (GetDriveType16( ofs->szPathName[0]-'A' )
                            != DRIVE_REMOVABLE);
-        dprintf_info(file, "OpenFile(%s): OF_PARSE, res = '%s'\n",
+        TRACE(file, "(%s): OF_PARSE, res = '%s'\n",
                       name, ofs->szPathName );
         return 0;
     }
@@ -797,7 +797,7 @@
     if (!DIR_SearchPath( NULL, name, NULL, &full_name, win32 )) goto not_found;
 
 found:
-    dprintf_info(file, "OpenFile: found %s = %s\n",
+    TRACE(file, "found %s = %s\n",
                   full_name.long_name, full_name.short_name );
     lstrcpyn32A( ofs->szPathName, full_name.short_name,
                  sizeof(ofs->szPathName) );
@@ -805,7 +805,7 @@
     if (mode & OF_DELETE)
     {
         if (unlink( full_name.long_name ) == -1) goto not_found;
-        dprintf_info(file, "OpenFile(%s): OF_DELETE return = OK\n", name);
+        TRACE(file, "(%s): OF_DELETE return = OK\n", name);
         return 1;
     }
 
@@ -829,7 +829,7 @@
         if (memcmp( ofs->reserved, filedatetime, sizeof(ofs->reserved) ))
         {
             CloseHandle( hFileRet );
-            dprintf_warn(file, "OpenFile(%s): OF_VERIFY failed\n", name );
+            WARN(file, "(%s): OF_VERIFY failed\n", name );
             /* FIXME: what error here? */
             DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk );
             goto error;
@@ -838,19 +838,19 @@
     memcpy( ofs->reserved, filedatetime, sizeof(ofs->reserved) );
 
 success:  /* We get here if the open was successful */
-    dprintf_info(file, "OpenFile(%s): OK, return = %d\n", name, hFileRet );
+    TRACE(file, "(%s): OK, return = %d\n", name, hFileRet );
     if (mode & OF_EXIST) /* Return the handle, but close it first */
         CloseHandle( hFileRet );
     return hFileRet;
 
 not_found:  /* We get here if the file does not exist */
-    dprintf_warn(file, "OpenFile: '%s' not found\n", name );
+    WARN(file, "'%s' not found\n", name );
     DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk );
     /* fall through */
 
 error:  /* We get here if there was an error opening the file */
     ofs->nErrCode = DOS_ExtendedError;
-    dprintf_warn(file, "OpenFile(%s): return = HFILE_ERROR error= %d\n", 
+    WARN(file, "(%s): return = HFILE_ERROR error= %d\n", 
 		  name,ofs->nErrCode );
     return HFILE_ERROR32;
 }
@@ -879,7 +879,7 @@
  */
 HFILE16 WINAPI _lclose16( HFILE16 hFile )
 {
-    dprintf_info(file, "_lclose16: handle %d\n", hFile );
+    TRACE(file, "handle %d\n", hFile );
     return CloseHandle( hFile ) ? 0 : HFILE_ERROR16;
 }
 
@@ -889,7 +889,7 @@
  */
 HFILE32 WINAPI _lclose32( HFILE32 hFile )
 {
-    dprintf_info(file, "_lclose32: handle %d\n", hFile );
+    TRACE(file, "handle %d\n", hFile );
     return CloseHandle( hFile ) ? 0 : HFILE_ERROR32;
 }
 
@@ -901,7 +901,7 @@
 {
     LONG maxlen;
 
-    dprintf_info(file, "WIN16_hread: %d %08lx %ld\n",
+    TRACE(file, "%d %08lx %ld\n",
                   hFile, (DWORD)buffer, count );
 
     /* Some programs pass a count larger than the allocated buffer */
@@ -929,7 +929,7 @@
     DWORD numWritten;
     BOOL32 result = FALSE;
 
-    dprintf_info( file, "_lread32: %d %p %d\n", handle, buffer, count);
+    TRACE( file, "%d %p %d\n", handle, buffer, count);
     if (!(ptr = HANDLE_GetObjPtr( handle, K32OBJ_UNKNOWN, 0))) return -1;
     if (K32OBJ_OPS(ptr)->read)
         result = K32OBJ_OPS(ptr)->read(ptr, buffer, count, &numWritten, NULL);
@@ -954,7 +954,7 @@
 HFILE16 WINAPI _lcreat16( LPCSTR path, INT16 attr )
 {
     int mode = (attr & 1) ? 0444 : 0666;
-    dprintf_info(file, "_lcreat16: %s %02x\n", path, attr );
+    TRACE(file, "%s %02x\n", path, attr );
     return (HFILE16)FILE_Create( path, mode, FALSE );
 }
 
@@ -965,7 +965,7 @@
 HFILE32 WINAPI _lcreat32( LPCSTR path, INT32 attr )
 {
     int mode = (attr & 1) ? 0444 : 0666;
-    dprintf_info(file, "_lcreat32: %s %02x\n", path, attr );
+    TRACE(file, "%s %02x\n", path, attr );
     return FILE_Create( path, mode, FALSE );
 }
 
@@ -976,7 +976,7 @@
 HFILE32 _lcreat_uniq( LPCSTR path, INT32 attr )
 {
     int mode = (attr & 1) ? 0444 : 0666;
-    dprintf_info(file, "_lcreat_uniq: %s %02x\n", path, attr );
+    TRACE(file, "%s %02x\n", path, attr );
     return FILE_Create( path, mode, TRUE );
 }
 
@@ -996,7 +996,7 @@
         SetLastError( ERROR_INVALID_PARAMETER );
         return 0xffffffff;
     }
-    dprintf_info(file, "SetFilePointer: handle %d offset %ld origin %ld\n",
+    TRACE(file, "handle %d offset %ld origin %ld\n",
                   hFile, distance, method );
 
     if (!(file = FILE_GetFile( hFile ))) return 0xffffffff;
@@ -1048,7 +1048,7 @@
 {
     INT32 unixMode;
 
-    dprintf_info(file, "_lopen32('%s',%04x)\n", path, mode );
+    TRACE(file, "('%s',%04x)\n", path, mode );
 
     switch(mode & 3)
     {
@@ -1127,7 +1127,7 @@
 	DWORD result;
 	BOOL32 status = FALSE;
 	
-	dprintf_info(file, "_hwrite32: %d %p %ld\n", handle, buffer, count );
+	TRACE(file, "%d %p %ld\n", handle, buffer, count );
 
 	if (count == 0) {       /* Expand or truncate at current position */
 		FILE_OBJECT *file = FILE_GetFile(handle);
@@ -1162,7 +1162,7 @@
     PDB *pdb = (PDB *)GlobalLock16( hPDB );
     BYTE *files = PTR_SEG_TO_LIN( pdb->fileHandlesPtr );
 
-    dprintf_info(file, "SetHandleCount16(%d)\n", count );
+    TRACE(file, "(%d)\n", count );
 
     if (count < 20) count = 20;  /* No point in going below 20 */
     else if (count > 254) count = 254;
@@ -1222,7 +1222,7 @@
     FILE_OBJECT *file;
     BOOL32 ret;
 
-    dprintf_info(file, "FlushFileBuffers(%d)\n", hFile );
+    TRACE(file, "(%d)\n", hFile );
     if (!(file = FILE_GetFile( hFile ))) return FALSE;
     if (fsync( file->unix_handle ) != -1) ret = TRUE;
     else
@@ -1243,7 +1243,7 @@
     FILE_OBJECT *file;
     BOOL32 ret = TRUE;
 
-    dprintf_info(file, "SetEndOfFile(%d)\n", hFile );
+    TRACE(file, "(%d)\n", hFile );
     if (!(file = FILE_GetFile( hFile ))) return FALSE;
     if (ftruncate( file->unix_handle,
                    lseek( file->unix_handle, 0, SEEK_CUR ) ))
@@ -1272,7 +1272,7 @@
 {
     DOS_FULL_NAME full_name;
 
-    dprintf_info(file, "DeleteFile: '%s'\n", path );
+    TRACE(file, "'%s'\n", path );
 
     if (DOSFS_IsDevice( path ))
     {
@@ -1445,7 +1445,7 @@
     DOS_FULL_NAME full_name1, full_name2;
     int mode=0; /* mode == 1: use copy */
 
-    dprintf_info(file, "MoveFileEx32A(%s,%s,%04lx)\n", fn1, fn2, flag);
+    TRACE(file, "(%s,%s,%04lx)\n", fn1, fn2, flag);
 
     if (!DOSFS_GetFullName( fn1, TRUE, &full_name1 )) return FALSE;
     if (fn2) { /* !fn2 means delete fn1 */
@@ -1545,7 +1545,7 @@
     DOS_FULL_NAME full_name1, full_name2;
     struct stat fstat;
 
-    dprintf_info(file, "MoveFile32A(%s,%s)\n", fn1, fn2 );
+    TRACE(file, "(%s,%s)\n", fn1, fn2 );
 
     if (!DOSFS_GetFullName( fn1, TRUE, &full_name1 )) return FALSE;
     if (DOSFS_GetFullName( fn2, TRUE, &full_name2 )) 
@@ -1563,7 +1563,7 @@
     else /*copy */ {
       if (stat(  full_name1.long_name, &fstat ))
 	{
-	  dprintf_warn(file, "Invalid source file %s\n",
+	  WARN(file, "Invalid source file %s\n",
 			full_name1.long_name);
 	  FILE_SetDosError();
 	  return FALSE;
@@ -1664,7 +1664,7 @@
     struct utimbuf utimbuf;
     
     if (!file) return FILE_TYPE_UNKNOWN; /* FIXME: correct? */
-    dprintf_info(file,"SetFileTime(%s,%p,%p,%p)\n",
+    TRACE(file,"(%s,%p,%p,%p)\n",
 	file->unix_name,
 	lpCreationTime,
 	lpLastAccessTime,
@@ -1781,12 +1781,12 @@
   struct flock f;
   FILE_OBJECT *file;
 
-  dprintf_info(file, "LockFile32: handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n",
+  TRACE(file, "handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n",
 	       hFile, dwFileOffsetLow, dwFileOffsetHigh,
 	       nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh);
 
   if (dwFileOffsetHigh || nNumberOfBytesToLockHigh) {
-    dprintf_fixme(file, "LockFile32: Unimplemented bytes > 32bits\n");
+    FIXME(file, "Unimplemented bytes > 32bits\n");
     return FALSE;
   }
 
@@ -1832,12 +1832,12 @@
   FILE_OBJECT *file;
   struct flock f;
 
-  dprintf_info(file, "UnlockFile32: handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n",
+  TRACE(file, "handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n",
 	       hFile, dwFileOffsetLow, dwFileOffsetHigh,
 	       nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh);
 
   if (dwFileOffsetHigh || nNumberOfBytesToUnlockHigh) {
-    dprintf_warn(file, "UnlockFile32: Unimplemented bytes > 32bits\n");
+    WARN(file, "Unimplemented bytes > 32bits\n");
     return FALSE;
   }
 
diff --git a/files/profile.c b/files/profile.c
index 2b6f7eb..29e2f06 100644
--- a/files/profile.c
+++ b/files/profile.c
@@ -215,12 +215,12 @@
         *prev_key  = key;
         prev_key = &key->next;
     }
-    if (debugging_info(profile))
+    if (TRACE_ON(profile))
     {
-        dprintf_info(profile, "PROFILE_Load:\n" );
+        TRACE(profile, "dump:\n" );
 	/* FIXME: improper use of stddeb! */
         PROFILE_Save(stddeb, first_section );
-        dprintf_info(profile, "PROFILE_Load finished.\n" );
+        TRACE(profile, "finished.\n" );
     }
     return first_section;
 }
@@ -357,7 +357,7 @@
         return FALSE;
     }
 
-    dprintf_info(profile, "Saving '%s' into '%s'\n",
+    TRACE(profile, "Saving '%s' into '%s'\n",
                      CurProfile.dos_name, unix_name );
     PROFILE_Save( file, CurProfile.section );
     fclose( file );
@@ -380,7 +380,7 @@
 
     if (CurProfile.filename && !strcmp( filename, CurProfile.filename ))
     {
-        dprintf_info(profile, "PROFILE_Open(%s): already opened\n",
+        TRACE(profile, "(%s): already opened\n",
                          filename );
         return TRUE;
     }
@@ -400,7 +400,7 @@
     if (CurProfile.dos_name &&
         !strcmp( full_name.short_name, CurProfile.dos_name ))
     {
-        dprintf_info(profile, "PROFILE_Open(%s): already opened\n",
+        TRACE(profile, "(%s): already opened\n",
                          filename );
         return TRUE;
     }
@@ -429,7 +429,7 @@
         CharLower32A( p );
         if ((file = fopen( buffer, "r" )))
         {
-            dprintf_info(profile, "PROFILE_Open(%s): found it in %s\n",
+            TRACE(profile, "(%s): found it in %s\n",
                              filename, buffer );
             CurProfile.unix_name = HEAP_strdupA( SystemHeap, 0, buffer );
         }
@@ -440,7 +440,7 @@
         CurProfile.unix_name = HEAP_strdupA( SystemHeap, 0,
                                              full_name.long_name );
         if ((file = fopen( full_name.long_name, "r" )))
-            dprintf_info(profile, "PROFILE_Open(%s): found it in %s\n",
+            TRACE(profile, "(%s): found it in %s\n",
                              filename, full_name.long_name );
     }
 
@@ -506,7 +506,7 @@
         key = PROFILE_Find( &CurProfile.section, section, key_name, FALSE );
         PROFILE_CopyEntry( buffer, (key && key->value) ? key->value : def_val,
                            len, FALSE );
-        dprintf_info(profile, "PROFILE_GetString('%s','%s','%s'): returning '%s'\n",
+        TRACE(profile, "('%s','%s','%s'): returning '%s'\n",
                          section, key_name, def_val, buffer );
         return strlen( buffer );
     }
@@ -524,7 +524,7 @@
 {
     if (!key_name)  /* Delete a whole section */
     {
-        dprintf_info(profile, "PROFILE_DeleteSection('%s')\n", section_name);
+        TRACE(profile, "('%s')\n", section_name);
         CurProfile.changed |= PROFILE_DeleteSection( &CurProfile.section,
                                                      section_name );
         return TRUE;         /* Even if PROFILE_DeleteSection() has failed,
@@ -532,7 +532,7 @@
     }
     else if (!value)  /* Delete a key */
     {
-        dprintf_info(profile, "PROFILE_DeleteKey('%s','%s')\n",
+        TRACE(profile, "('%s','%s')\n",
                          section_name, key_name );
         CurProfile.changed |= PROFILE_DeleteKey( &CurProfile.section,
                                                  section_name, key_name );
@@ -542,20 +542,20 @@
     {
         PROFILEKEY *key = PROFILE_Find( &CurProfile.section, section_name,
                                         key_name, TRUE );
-        dprintf_info(profile, "PROFILE_SetString('%s','%s','%s'): \n",
+        TRACE(profile, "('%s','%s','%s'): \n",
                          section_name, key_name, value );
         if (!key) return FALSE;
         if (key->value)
         {
             if (!strcmp( key->value, value ))
             {
-                dprintf_info(profile, "  no change needed\n" );
+                TRACE(profile, "  no change needed\n" );
                 return TRUE;  /* No change needed */
             }
-            dprintf_info(profile, "  replacing '%s'\n", key->value );
+            TRACE(profile, "  replacing '%s'\n", key->value );
             HeapFree( SystemHeap, 0, key->value );
         }
-        else dprintf_info(profile, "  creating key\n" );
+        else TRACE(profile, "  creating key\n" );
         key->value = HEAP_strdupA( SystemHeap, 0, value );
         CurProfile.changed = TRUE;
     }
@@ -576,7 +576,7 @@
         PROFILEKEY *key = PROFILE_Find(&WineProfile, section, key_name, FALSE);
         PROFILE_CopyEntry( buffer, (key && key->value) ? key->value : def,
                            len, TRUE );
-        dprintf_info(profile, "PROFILE_GetWineIniString('%s','%s','%s'): returning '%s'\n",
+        TRACE(profile, "('%s','%s','%s'): returning '%s'\n",
                          section, key_name, def, buffer );
         return strlen( buffer );
     }
@@ -707,7 +707,7 @@
 	retval = def;
     }
 
-    dprintf_info(profile, "PROFILE_GetWineIniBool(\"%s\", \"%s\", %s), "
+    TRACE(profile, "(\"%s\", \"%s\", %s), "
 		    "[%c], ret %s.\n", section, key_name,
 		    def ? "TRUE" : "FALSE", key_value[0],
 		    retval ? "TRUE" : "FALSE");
@@ -1031,11 +1031,11 @@
 {
     char *p =(char*)string;
 
-    dprintf_fixme(profile, "WritePrivateProfileSection32A empty stup\n");
-    if (debugging_info(profile)) {
-      dprintf_info(profile, "file(%s) => [%s]\n", filename, section);
+    FIXME(profile, "WritePrivateProfileSection32A empty stup\n");
+    if (TRACE_ON(profile)) {
+      TRACE(profile, "(%s) => [%s]\n", filename, section);
       while (*(p+1)) {
-	dprintf_info(profile, "%s\n", p);
+	TRACE(profile, "%s\n", p);
         p += strlen(p);
 	p += 1;
       }
diff --git a/graphics/bitblt.c b/graphics/bitblt.c
index f779dfd..2c2453b 100644
--- a/graphics/bitblt.c
+++ b/graphics/bitblt.c
@@ -17,7 +17,7 @@
     DC * dc = DC_GetDCPtr( hdc );
     if (!dc || !dc->funcs->pPatBlt) return FALSE;
 
-    dprintf_info(bitblt, "PatBlt16: %04x %d,%d %dx%d %06lx\n",
+    TRACE(bitblt, "%04x %d,%d %dx%d %06lx\n",
                     hdc, left, top, width, height, rop );
     return dc->funcs->pPatBlt( dc, left, top, width, height, rop );
 }
@@ -32,7 +32,7 @@
     DC * dc = DC_GetDCPtr( hdc );
     if (!dc || !dc->funcs->pPatBlt) return FALSE;
 
-    dprintf_info(bitblt, "PatBlt32: %04x %d,%d %dx%d %06lx\n",
+    TRACE(bitblt, "%04x %d,%d %dx%d %06lx\n",
                     hdc, left, top, width, height, rop );
     return dc->funcs->pPatBlt( dc, left, top, width, height, rop );
 }
@@ -51,10 +51,9 @@
     if (!dcDst->funcs->pBitBlt) return FALSE;
     dcSrc = DC_GetDCPtr( hdcSrc );
 
-    dprintf_info(bitblt,
-                "BitBlt16: hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
-                hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
-                hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
+    TRACE(bitblt, "hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
+		 hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
+		 hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
     return dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height,
                                   dcSrc, xSrc, ySrc, rop );
 }
@@ -73,10 +72,9 @@
     if (!dcDst->funcs->pBitBlt) return FALSE;
     dcSrc = DC_GetDCPtr( hdcSrc );
 
-    dprintf_info(bitblt,
-                "BitBlt32: hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
-                hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
-                hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
+    TRACE(bitblt, "hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
+		 hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
+		 hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
     return dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height,
                                   dcSrc, xSrc, ySrc, rop );
 }
@@ -96,11 +94,10 @@
     if (!dcDst->funcs->pStretchBlt) return FALSE;
     dcSrc = DC_GetDCPtr( hdcSrc );
 
-    dprintf_info(bitblt,
-        "StretchBlt16: %04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
-                   hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
-                   dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
-                   widthDst, heightDst, dcDst->w.bitsPerPixel, rop );
+    TRACE(bitblt, "%04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
+		 hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
+		 dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
+		 widthDst, heightDst, dcDst->w.bitsPerPixel, rop );
     return dcDst->funcs->pStretchBlt( dcDst, xDst, yDst, widthDst, heightDst,
                                       dcSrc, xSrc, ySrc, widthSrc, heightSrc,
                                       rop );
@@ -121,11 +118,10 @@
     if (!dcDst->funcs->pStretchBlt) return FALSE;
     dcSrc = DC_GetDCPtr( hdcSrc );
 
-    dprintf_info(bitblt,
-        "StretchBlt32: %04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
-                   hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
-                   dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
-                   widthDst, heightDst, dcDst->w.bitsPerPixel, rop );
+    TRACE(bitblt, "%04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
+		 hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
+		 dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
+		 widthDst, heightDst, dcDst->w.bitsPerPixel, rop );
     return dcDst->funcs->pStretchBlt( dcDst, xDst, yDst, widthDst, heightDst,
                                       dcSrc, xSrc, ySrc, widthSrc, heightSrc,
                                       rop );
diff --git a/graphics/ddraw.c b/graphics/ddraw.c
index 3b13507..33c7d1b 100644
--- a/graphics/ddraw.c
+++ b/graphics/ddraw.c
@@ -336,14 +336,14 @@
 static HRESULT WINAPI IDirectDrawSurface_Lock(
     LPDIRECTDRAWSURFACE this,LPRECT32 lprect,LPDDSURFACEDESC lpddsd,DWORD flags, HANDLE32 hnd
 ) {
-        dprintf_info(ddraw, "IDirectDrawSurface(%p)->Lock(%p,%p,%08lx,%08lx)\n",
+        TRACE(ddraw, "(%p)->Lock(%p,%p,%08lx,%08lx)\n",
 		this,lprect,lpddsd,flags,(DWORD)hnd);
 	if (flags & ~(DDLOCK_WAIT|DDLOCK_READONLY|DDLOCK_WRITEONLY))
-	    dprintf_warn(ddraw, "IDirectDrawSurface(%p)->Lock(%p,%p,%08lx,%08lx)\n",
+	    WARN(ddraw, "(%p)->Lock(%p,%p,%08lx,%08lx)\n",
 			 this,lprect,lpddsd,flags,(DWORD)hnd);
 
 	if (lprect) {
-		dprintf_info(ddraw,"	lprect: %dx%d-%dx%d\n",
+		TRACE(ddraw,"	lprect: %dx%d-%dx%d\n",
 			lprect->top,lprect->left,lprect->bottom,lprect->right
 		);
 		lpddsd->y.lpSurface =	this->s.surface+
@@ -362,14 +362,14 @@
 static HRESULT WINAPI IDirectDrawSurface_Unlock(
 	LPDIRECTDRAWSURFACE this,LPVOID surface
 ) {
-	dprintf_info(ddraw,"IDirectDrawSurface(%p)->Unlock(%p)\n",this,surface);
+	TRACE(ddraw,"(%p)->Unlock(%p)\n",this,surface);
 	return 0;
 }
 
 static HRESULT WINAPI IDirectDrawSurface_Flip(
 	LPDIRECTDRAWSURFACE this,LPDIRECTDRAWSURFACE flipto,DWORD dwFlags
 ) {
-	dprintf_info(ddraw,"IDirectDrawSurface(%p)->Flip(%p,%08lx)\n",this,flipto,dwFlags);
+	TRACE(ddraw,"(%p)->Flip(%p,%08lx)\n",this,flipto,dwFlags);
 	if (!flipto) {
 		if (this->s.backbuffer)
 			flipto = this->s.backbuffer;
@@ -399,7 +399,7 @@
 static HRESULT WINAPI IDirectDrawSurface_SetPalette(
 	LPDIRECTDRAWSURFACE this,LPDIRECTDRAWPALETTE pal
 ) {
-	dprintf_info(ddraw,"IDirectDrawSurface(%p)->SetPalette(%p)\n",this,pal);
+	TRACE(ddraw,"(%p)->SetPalette(%p)\n",this,pal);
 	this->s.palette = pal; /* probably addref it too */
 	return 0;
 }
@@ -475,7 +475,7 @@
 	LPDIRECTDRAWSURFACE this,DWORD dstx,DWORD dsty,LPDIRECTDRAWSURFACE src,LPRECT32 rsrc,DWORD trans
 ) {
 	int	i,bpp;
-	if (debugging_info(ddraw)) {
+	if (TRACE_ON(ddraw)) {
 	    fprintf(stderr,"IDirectDrawSurface(%p)->BltFast(%ld,%ld,%p,%p,%08lx),stub!\n",
 		    this,dstx,dsty,src,rsrc,trans
 	    );
@@ -504,7 +504,7 @@
 static HRESULT WINAPI IDirectDrawSurface_GetCaps(
 	LPDIRECTDRAWSURFACE this,LPDDSCAPS caps
 ) {
-	dprintf_info(ddraw,"IDirectDrawSurface(%p)->GetCaps(%p)\n",this,caps);
+	TRACE(ddraw,"(%p)->GetCaps(%p)\n",this,caps);
 	caps->dwCaps = DDCAPS_PALETTE; /* probably more */
 	return 0;
 }
@@ -512,8 +512,8 @@
 static HRESULT WINAPI IDirectDrawSurface_GetSurfaceDesc(
 	LPDIRECTDRAWSURFACE this,LPDDSURFACEDESC ddsd
 ) { 
-	if (debugging_info(ddraw)) {
-		dprintf_info(ddraw, "IDirectDrawSurface(%p)->GetSurfaceDesc(%p)\n",
+	if (TRACE_ON(ddraw)) {
+		TRACE(ddraw, "(%p)->GetSurfaceDesc(%p)\n",
 			     this,ddsd);
 		fprintf(stderr,"	flags: ");
 		_dump_DDSD(ddsd->dwFlags);
@@ -534,12 +534,12 @@
 }
 
 static ULONG WINAPI IDirectDrawSurface_AddRef(LPDIRECTDRAWSURFACE this) {
-	dprintf_info(ddraw,"IDirectDrawSurface(%p)->AddRef()\n",this);
+	TRACE(ddraw,"(%p)->AddRef()\n",this);
 	return ++(this->ref);
 }
 
 static ULONG WINAPI IDirectDrawSurface_Release(LPDIRECTDRAWSURFACE this) {
-	dprintf_info(ddraw,"IDirectDrawSurface(%p)->Release()\n",this);
+	TRACE(ddraw,"(%p)->Release()\n",this);
 	if (!--(this->ref)) {
 		this->s.ddraw->lpvtbl->fnRelease(this->s.ddraw);
 		/* clear out of surface list */
@@ -557,9 +557,9 @@
 static HRESULT WINAPI IDirectDrawSurface_GetAttachedSurface(
 	LPDIRECTDRAWSURFACE this,LPDDSCAPS lpddsd,LPDIRECTDRAWSURFACE *lpdsf
 ) {
-        dprintf_info(ddraw, "IDirectDrawSurface(%p)->GetAttachedSurface(%p,%p)\n",
+        TRACE(ddraw, "(%p)->GetAttachedSurface(%p,%p)\n",
 		     this, lpddsd, lpdsf);
-	if (debugging_info(ddraw)) {
+	if (TRACE_ON(ddraw)) {
 		fprintf(stderr,"	caps ");
 		_dump_DDSCAPS(lpddsd->dwCaps);
 		fprintf(stderr,"\n");
@@ -625,7 +625,7 @@
         char    xrefiid[50];
 
         WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
-        dprintf_info(ddraw,"IDirectDrawSurface(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
+        TRACE(ddraw,"(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
 	
 	/* thats version 3 (DirectX 5) */
 	if (	!memcmp(&IID_IDirectDrawSurface3,refiid,sizeof(IID_IDirectDrawSurface3))) {
@@ -708,7 +708,7 @@
 static HRESULT WINAPI IDirectDrawSurface2_Unlock(
 	LPDIRECTDRAWSURFACE2 this,LPVOID surface
 ) {
-	dprintf_info(ddraw,"IDirectDrawSurface2(%p)->Unlock(%p)\n",this,surface);
+	TRACE(ddraw,"(%p)->Unlock(%p)\n",this,surface);
 	return 0;
 }
 
@@ -719,7 +719,7 @@
 }
 
 static ULONG WINAPI IDirectDrawSurface2_AddRef(LPDIRECTDRAWSURFACE2 this) {
-	dprintf_info(ddraw,"IDirectDrawSurface2(%p)->AddRef()\n",this);
+	TRACE(ddraw,"(%p)->AddRef()\n",this);
 	return ++(this->ref);
 }
 
@@ -821,12 +821,12 @@
 }
 
 static ULONG WINAPI IDirectDrawSurface3_AddRef(LPDIRECTDRAWSURFACE3 this) {
-	dprintf_info(ddraw,"IDirectDrawSurface3(%p)->AddRef()\n",this);
+	TRACE(ddraw,"(%p)->AddRef()\n",this);
 	return ++(this->ref);
 }
 
 static ULONG WINAPI IDirectDrawSurface3_Release(LPDIRECTDRAWSURFACE3 this) {
-	dprintf_info(ddraw,"IDirectDrawSurface3(%p)->Release()\n",this);
+	TRACE(ddraw,"(%p)->Release()\n",this);
 	if (!--(this->ref)) {
 		this->s.ddraw->lpvtbl->fnRelease(this->s.ddraw);
 		this->s.ddraw->d.vpmask &= ~(1<<(this->s.fb_height/this->s.ddraw->d.fb_height));
@@ -991,7 +991,7 @@
 	XColor		xc;
 	int		i;
 
-	dprintf_info(ddraw,"IDirectDrawPalette(%p)->SetEntries(%08lx,%ld,%ld,%p)\n",
+	TRACE(ddraw,"(%p)->SetEntries(%08lx,%ld,%ld,%p)\n",
 		this,x,start,end,palent
 	);
 	if (!this->cm) /* should not happen */ {
@@ -1123,9 +1123,9 @@
 ) {
 	int	i;
 
-	dprintf_info(ddraw, "IDirectDraw(%p)->CreateSurface(%p,%p,%p)\n",
+	TRACE(ddraw, "(%p)->CreateSurface(%p,%p,%p)\n",
 		     this,lpddsd,lpdsf,lpunk);
-	if (debugging_info(ddraw)) {
+	if (TRACE_ON(ddraw)) {
 		fprintf(stderr,"[w=%ld,h=%ld,flags ",lpddsd->dwWidth,lpddsd->dwHeight);
 		_dump_DDSD(lpddsd->dwFlags);
 		fprintf(stderr,"caps ");
@@ -1147,12 +1147,12 @@
 		(*lpdsf)->s.surface = (LPBYTE)HeapAlloc(GetProcessHeap(),0,lpddsd->dwWidth*lpddsd->dwHeight*this->d.depth/8);
 		(*lpdsf)->s.fb_height = -1;
 		(*lpdsf)->s.lpitch = lpddsd->dwWidth*this->d.depth/8;
-		dprintf_info(ddraw,"using system memory for a primary surface\n");
+		TRACE(ddraw,"using system memory for a primary surface\n");
 	} else {
 		for (i=0;i<32;i++)
 			if (!(this->d.vpmask & (1<<i)))
 				break;
-		dprintf_info(ddraw,"using viewport %d for a primary surface\n",i);
+		TRACE(ddraw,"using viewport %d for a primary surface\n",i);
 		/* if i == 32 or maximum ... return error */
 		this->d.vpmask|=(1<<i);
 		(*lpdsf)->s.surface = this->d.fb_addr+((i*this->d.fb_height)*this->d.fb_width*this->d.depth/8);
@@ -1179,7 +1179,7 @@
 		for (i=0;i<32;i++)
 			if (!(this->d.vpmask & (1<<i)))
 				break;
-		dprintf_info(ddraw,"using viewport %d for backbuffer\n",i);
+		TRACE(ddraw,"using viewport %d for backbuffer\n",i);
 		/* if i == 32 or maximum ... return error */
 		this->d.vpmask|=(1<<i);
 		back->s.surface = this->d.fb_addr+((i*this->d.fb_height)*this->d.fb_width*this->d.depth/8);
@@ -1198,7 +1198,7 @@
 static HRESULT WINAPI IDirectDraw_DuplicateSurface(
 	LPDIRECTDRAW this,LPDIRECTDRAWSURFACE src,LPDIRECTDRAWSURFACE *dst
 ) {
-	fprintf(stderr,"IDirectDraw(%p)->DuplicateSurface(%p,%p)\n",this,src,dst);
+	fprintf(stderr,"(%p)->DuplicateSurface(%p,%p)\n",this,src,dst);
 	*dst = src; /* FIXME */
 	return 0;
 }
@@ -1222,15 +1222,15 @@
 		FE(DDSCL_CREATEDEVICEWINDOW)
 	};
 
-	dprintf_info(ddraw,"IDirectDraw(%p)->SetCooperativeLevel(%08lx,%08lx)\n",
+	TRACE(ddraw,"(%p)->SetCooperativeLevel(%08lx,%08lx)\n",
 		this,(DWORD)hwnd,cooplevel
 	);
-	if(debugging_info(ddraw)){
+	if(TRACE_ON(ddraw)){
 	  dbg_decl_str(ddraw, 512);
 	  for (i=0;i<sizeof(flagmap)/sizeof(flagmap[0]);i++)
 	    if (flagmap[i].mask & cooplevel)
 	      dsprintf(ddraw, "%s ", flagmap[i].name);
-	  dprintf_info(ddraw,"	cooperative level %s\n", dbg_str(ddraw));
+	  TRACE(ddraw,"	cooperative level %s\n", dbg_str(ddraw));
 	}
 	this->d.mainwindow = hwnd;
 	return 0;
@@ -1243,7 +1243,7 @@
 	int	i,*depths,depcount;
 	char	buf[200];
 
-	dprintf_fixme(ddraw, "IDirectDraw(%p)->SetDisplayMode(%ld,%ld,%ld),stub!\n",
+	TRACE(ddraw, "(%p)->SetDisplayMode(%ld,%ld,%ld)\n",
 		      this, width, height, depth);
 
 	depths = TSXListDepths(display,DefaultScreen(display),&depcount);
@@ -1273,7 +1273,10 @@
 	 * it works for the library too?
 	 */
 	XF86DGADirectVideo(display,DefaultScreen(display),XF86DGADirectGraphics);
+/*
 	XF86DGASetViewPort(display,DefaultScreen(display),0,this->d.fb_height);
+ */
+
 #ifdef RESTORE_SIGNALS
 	SIGNAL_InitEmulator();
 #endif
@@ -1283,7 +1286,7 @@
 static HRESULT WINAPI IDirectDraw_GetCaps(
 	LPDIRECTDRAW this,LPDDCAPS caps1,LPDDCAPS caps2
 )  {
-	dprintf_info(ddraw,"IDirectDraw(%p)->GetCaps(%p,%p)\n",this,caps1,caps2);
+	TRACE(ddraw,"(%p)->GetCaps(%p,%p)\n",this,caps1,caps2);
 	caps1->dwVidMemTotal = this->d.fb_memsize;
 	caps1->dwCaps = 0xffffffff&~(DDCAPS_BANKSWITCHED);		/* we can do anything */
 	caps1->ddsCaps.dwCaps = 0xffffffff;	/* we can do anything */
@@ -1298,7 +1301,7 @@
 static HRESULT WINAPI IDirectDraw_CreateClipper(
 	LPDIRECTDRAW this,DWORD x,LPDIRECTDRAWCLIPPER *lpddclip,LPUNKNOWN lpunk
 ) {
-	fprintf(stderr,"IDirectDraw(%p)->CreateClipper(%08lx,%p,%p),stub!\n",
+	fprintf(stderr,"(%p)->CreateClipper(%08lx,%p,%p),stub!\n",
 		this,x,lpddclip,lpunk
 	);
 	*lpddclip = (LPDIRECTDRAWCLIPPER)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectDrawClipper));
@@ -1310,7 +1313,7 @@
 static HRESULT WINAPI IDirectDraw_CreatePalette(
 	LPDIRECTDRAW this,DWORD x,LPPALETTEENTRY palent,LPDIRECTDRAWPALETTE *lpddpal,LPUNKNOWN lpunk
 ) {
-	dprintf_info(ddraw,"IDirectDraw(%p)->CreatePalette(%08lx,%p,%p,%p)\n",
+	TRACE(ddraw,"(%p)->CreatePalette(%08lx,%p,%p,%p)\n",
 		this,x,palent,lpddpal,lpunk
 	);
 	*lpddpal = (LPDIRECTDRAWPALETTE)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectDrawPalette));
@@ -1326,7 +1329,7 @@
 }
 
 static HRESULT WINAPI IDirectDraw_RestoreDisplayMode(LPDIRECTDRAW this) {
-	dprintf_fixme(ddraw, "IDirectDraw(%p)->RestoreDisplayMode(),stub!\n", 
+	TRACE(ddraw, "(%p)->RestoreDisplayMode()\n", 
 		      this);
 	Sleep(1000);
 	XF86DGADirectVideo(display,DefaultScreen(display),0);
@@ -1340,7 +1343,7 @@
 static HRESULT WINAPI IDirectDraw_WaitForVerticalBlank(
 	LPDIRECTDRAW this,DWORD x,HANDLE32 h
 ) {
-	dprintf_info(ddraw,"IDirectDraw(%p)->WaitForVerticalBlank(0x%08lx,0x%08x),stub!\n",this,x,h);
+	TRACE(ddraw,"(%p)->WaitForVerticalBlank(0x%08lx,0x%08x)\n",this,x,h);
 	return 0;
 }
 
@@ -1366,7 +1369,7 @@
         char    xrefiid[50];
 
         WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
-        dprintf_info(ddraw,"IDirectDraw(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
+        TRACE(ddraw,"(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
         if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) {
                 *obj = this;
 		this->lpvtbl->fnAddRef(this);
@@ -1405,14 +1408,14 @@
 		*obj = d3d;
 		return 0;
 	}
-	fprintf(stderr,"IDirectDraw(%p):interface for IID %s _NOT_ found!\n",this,xrefiid);
+	fprintf(stderr,"(%p):interface for IID %s _NOT_ found!\n",this,xrefiid);
         return OLE_E_ENUM_NOMORE;
 }
 
 static HRESULT WINAPI IDirectDraw_GetVerticalBlankStatus(
 	LPDIRECTDRAW this,BOOL32 *status
 ) {
-        dprintf_info(ddraw,"IDirectDraw(%p)->GetVerticalBlankSatus(%p)\n",this,status);
+        TRACE(ddraw,"(%p)->GetVerticalBlankSatus(%p)\n",this,status);
 	*status = TRUE;
 	return 0;
 }
@@ -1422,7 +1425,7 @@
 ) {
 	DDSURFACEDESC	ddsfd;
 
-	dprintf_info(ddraw,"IDirectDraw(%p)->EnumDisplayModes(0x%08lx,%p,%p,%p)\n",this,dwFlags,lpddsfd,context,modescb);
+	TRACE(ddraw,"(%p)->EnumDisplayModes(0x%08lx,%p,%p,%p)\n",this,dwFlags,lpddsfd,context,modescb);
 
 
 	_getpixelformat(this,&(ddsfd.ddpfPixelFormat));
@@ -1457,7 +1460,7 @@
 static HRESULT WINAPI IDirectDraw_GetDisplayMode(
 	LPDIRECTDRAW this,LPDDSURFACEDESC lpddsfd
 ) {
-	dprintf_info(ddraw,"IDirectDraw(%p)->GetDisplayMode(%p)\n",this,lpddsfd);
+	TRACE(ddraw,"(%p)->GetDisplayMode(%p)\n",this,lpddsfd);
 	lpddsfd->dwFlags = DDSD_HEIGHT|DDSD_WIDTH|DDSD_PITCH|DDSD_BACKBUFFERCOUNT|DDSD_PIXELFORMAT|DDSD_CAPS;
 	lpddsfd->dwHeight = screenHeight;
 	lpddsfd->dwWidth = screenWidth;
@@ -1470,14 +1473,14 @@
 }
 
 static HRESULT WINAPI IDirectDraw_FlipToGDISurface(LPDIRECTDRAW this) {
-	fprintf(stderr,"IDirectDraw(%p)->FlipToGDISurface(),stub!\n",this);
+	fprintf(stderr,"(%p)->FlipToGDISurface()\n",this);
 	return DD_OK;
 }
 
 static HRESULT WINAPI IDirectDraw_GetMonitorFrequency(
 	LPDIRECTDRAW this,LPDWORD freq
 ) {
-	fprintf(stderr,"IDirectDraw(%p)->GetMonitorFrequency(%p)\n",this,freq);
+	fprintf(stderr,"(%p)->GetMonitorFrequency(%p)\n",this,freq);
 	*freq = 60*100; /* 60 Hz */
 	return 0;
 }
@@ -1560,7 +1563,7 @@
 static HRESULT WINAPI IDirectDraw2_SetDisplayMode(
 	LPDIRECTDRAW2 this,DWORD width,DWORD height,DWORD depth,DWORD xx,DWORD yy
 ) {
-	dprintf_fixme(ddraw,"IDirectDraw2(%p)->SetDisplayMode(%ld,%ld,%ld,%08lx,%08lx),stub!\n",
+	TRACE(ddraw,"IDirectDraw2(%p)->SetDisplayMode(%ld,%ld,%ld,%08lx,%08lx)\n",
 		      this, width, height, depth, xx, yy);
 
 	return IDirectDraw_SetDisplayMode((LPDIRECTDRAW)this,width,height,depth);
@@ -1661,7 +1664,7 @@
 	else
 		strcpy(xclsid,"<null>");
 
-	dprintf_info(ddraw,"DirectDrawCreate(%s,%p,%p)\n",xclsid,lplpDD,pUnkOuter);
+	TRACE(ddraw,"(%s,%p,%p)\n",xclsid,lplpDD,pUnkOuter);
 	if (getuid()) {
 		MessageBox32A(0,"Using the XF86DGA extension requires the program to be run using UID 0.","WINE DirectDraw",MB_OK|MB_ICONSTOP);
 		return E_UNEXPECTED;
@@ -1674,12 +1677,12 @@
 		return 0;
 	}
 	XF86DGAQueryVersion(display,&major,&minor);
-	dprintf_info(ddraw,"XF86DGA is version %d.%d\n",major,minor);
+	TRACE(ddraw,"XF86DGA is version %d.%d\n",major,minor);
 	XF86DGAQueryDirectVideo(display,DefaultScreen(display),&flags);
 	if (!(flags & XF86DGADirectPresent))
 		fprintf(stderr,"direct video is NOT ENABLED.\n");
 	XF86DGAGetVideo(display,DefaultScreen(display),&addr,&width,&banksize,&memsize);
-	dprintf_info(ddraw,"video framebuffer: begin %p, width %d,banksize %d,memsize %d\n",
+	TRACE(ddraw,"video framebuffer: begin %p, width %d,banksize %d,memsize %d\n",
 		addr,width,banksize,memsize
 	);
 	(*lplpDD)->d.fb_width = width;
@@ -1692,7 +1695,7 @@
 	(*lplpDD)->d.vp_width = width;
 	(*lplpDD)->d.vp_height = height;
 	(*lplpDD)->d.fb_height = screenHeight;
-	(*lplpDD)->d.vpmask = 1;
+	(*lplpDD)->d.vpmask = 0;
 
 	/* just assume the default depth is the DGA depth too */
 	(*lplpDD)->d.depth = DefaultDepthOfScreen(screen);
diff --git a/graphics/mapping.c b/graphics/mapping.c
index 8ad198d..0600e94 100644
--- a/graphics/mapping.c
+++ b/graphics/mapping.c
@@ -163,7 +163,7 @@
     if (!dc) return 0;
     if (dc->funcs->pSetMapMode) return dc->funcs->pSetMapMode( dc, mode );
 
-    dprintf_info(gdi, "SetMapMode: %04x %d\n", hdc, mode );
+    TRACE(gdi, "%04x %d\n", hdc, mode );
     
     prevMode = dc->w.MapMode;
     switch(mode)
diff --git a/graphics/metafiledrv/init.c b/graphics/metafiledrv/init.c
index 9d232bc..a02d7ff 100644
--- a/graphics/metafiledrv/init.c
+++ b/graphics/metafiledrv/init.c
@@ -150,7 +150,7 @@
     METAFILEDRV_PDEVICE *physDev;
     HFILE32 hFile;
 
-    dprintf_info(metafile, "CreateMetaFile16: '%s'\n", filename );
+    TRACE(metafile, "'%s'\n", filename );
 
     if (!(dc = MFDRV_AllocMetaFile())) return 0;
     physDev = (METAFILEDRV_PDEVICE *)dc->physDev;
@@ -175,7 +175,7 @@
     else  /* memory based metafile */
 	physDev->mh->mtType = METAFILE_MEMORY;
 
-    dprintf_info(metafile, "CreateMetaFile16: returning %04x\n", dc->hSelf);
+    TRACE(metafile, "returning %04x\n", dc->hSelf);
     return dc->hSelf;
 }
 
@@ -198,7 +198,7 @@
     HFILE32 hFile;
     METAFILEDRV_PDEVICE *physDev;
     
-    dprintf_info(metafile, "CloseMetaFile(%04x)\n", hdc );
+    TRACE(metafile, "(%04x)\n", hdc );
 
     if (!(dc = (DC *) GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ))) return 0;
     physDev = (METAFILEDRV_PDEVICE *)dc->physDev;
diff --git a/graphics/metafiledrv/objects.c b/graphics/metafiledrv/objects.c
index de8bbc6..6488df8 100644
--- a/graphics/metafiledrv/objects.c
+++ b/graphics/metafiledrv/objects.c
@@ -85,7 +85,7 @@
     HGDIOBJ32 ret = 0;
 
     if (!ptr) return 0;
-    dprintf_info(gdi, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle );
+    TRACE(gdi, "hdc=%04x %04x\n", dc->hSelf, handle );
     
     switch(ptr->wMagic)
     {
diff --git a/graphics/path.c b/graphics/path.c
index d53acd9..09dbc5f 100644
--- a/graphics/path.c
+++ b/graphics/path.c
@@ -227,8 +227,7 @@
 INT16 WINAPI GetPath16(HDC16 hdc, LPPOINT16 pPoints, LPBYTE pTypes,
    INT16 nSize)
 {
-   /* FIXME: Not implemented */
-   fprintf(stdnimp, "GetPath16: Unimplemented stub\n");
+   FIXME(gdi, "Unimplemented stub\n");
 
    return 0;
 }
diff --git a/graphics/win16drv/brush.c b/graphics/win16drv/brush.c
index 7f397de..a437d21 100644
--- a/graphics/win16drv/brush.c
+++ b/graphics/win16drv/brush.c
@@ -25,7 +25,7 @@
 
     if ( physDev->BrushInfo )
     {
-        dprintf_info(win16drv, "UnRealizing BrushInfo\n");
+        TRACE(win16drv, "UnRealizing BrushInfo\n");
         nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_BRUSH,
 				      physDev->BrushInfo,
 				      physDev->BrushInfo, 0);
diff --git a/graphics/win16drv/font.c b/graphics/win16drv/font.c
index f0c8dce..f735eff 100644
--- a/graphics/win16drv/font.c
+++ b/graphics/win16drv/font.c
@@ -24,7 +24,7 @@
     WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
     DWORD dwRet;
     
-    dprintf_info(win16drv, "WIN16DRV_GetTextExtPoint: %04x %s %d %p\n",
+    TRACE(win16drv, "%04x %s %d %p\n",
 		                dc->hSelf, str, count, size);
 
     dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, 0, 0, 
@@ -34,7 +34,7 @@
 			      win16drv_SegPtr_TextXForm, NULL, NULL, 0);
     size->cx = XDSTOLS(dc,LOWORD(dwRet));
     size->cy = YDSTOLS(dc,HIWORD(dwRet));
-    dprintf_info(win16drv, "WIN16DRV_GetTextExtPoint: cx=0x%x, cy=0x%x\n",
+    TRACE(win16drv, "cx=0x%x, cy=0x%x\n",
 		size->cx, size->cy );
     return TRUE;
 }
@@ -47,12 +47,11 @@
 {
     WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
 
-    dprintf_info(win16drv, "WIN16DRV_GetTextMetrics: %04x \n", dc->hSelf);
+    TRACE(win16drv, "%04x \n", dc->hSelf);
 
     FONT_TextMetric16to32A( &physDev->tm, metrics );
 
-    dprintf_info(win16drv,
-	   "H %d, A %d, D %d, Int %d, Ext %d, AW %d, MW %d, W %d\n",
+    TRACE(win16drv, "H %d, A %d, D %d, Int %d, Ext %d, AW %d, MW %d, W %d\n",
            metrics->tmHeight,
            metrics->tmAscent,
            metrics->tmDescent,
@@ -73,13 +72,13 @@
 
     dc->w.hFont = hfont;
 
-    dprintf_info(win16drv, "WIN16DRV_FONT_SelectObject '%s' h=%d\n",
+    TRACE(win16drv, "WIN16DRV_FONT_SelectObject '%s' h=%d\n",
 		     font->logfont.lfFaceName, font->logfont.lfHeight);
 
 
     if( physDev->FontInfo )
     {
-        dprintf_info(win16drv, "UnRealizing FontInfo\n");
+        TRACE(win16drv, "UnRealizing FontInfo\n");
         nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_FONT,
 				      physDev->FontInfo,
 				      physDev->FontInfo, 0);
@@ -129,8 +128,7 @@
     physDev->tm.tmCharSet          = fi->dfCharSet;
 #undef fi
 
-    dprintf_info(win16drv,
-           "H %d, A %d, D %d, Int %d, Ext %d, AW %d, MW %d, W %d\n",
+    TRACE(win16drv, "H %d, A %d, D %d, Int %d, Ext %d, AW %d, MW %d, W %d\n",
            physDev->tm.tmHeight,
            physDev->tm.tmAscent,
            physDev->tm.tmDescent,
@@ -154,16 +152,16 @@
 
     WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
     
-    dprintf_info(win16drv, "WIN16DRV_GetCharWidth: %d - %d into %p\n",
+    TRACE(win16drv, "%d - %d into %p\n",
 		      firstChar, lastChar, buffer );
 
     wRet = PRTDRV_GetCharWidth( physDev->segptrPDEVICE, buffer, firstChar, 
 				lastChar, physDev->FontInfo, 
 				win16drv_SegPtr_DrawMode, 
 				win16drv_SegPtr_TextXForm );
-    if( debugging_info(win16drv) ){
+    if( TRACE_ON(win16drv) ){
         for(i = 0; i <= lastChar - firstChar; i++)
-	    dprintf_info(win16drv, "Char %x: width %d\n", i + firstChar,
+	    TRACE(win16drv, "Char %x: width %d\n", i + firstChar,
 			                 buffer[i]);
     }
 
@@ -207,7 +205,7 @@
                                   LPTEXTMETRIC16 lpTextMetrics,
                                   WORD wFontType, LONG lpClientData) 
 {
-    dprintf_info(win16drv, "In WineEnumDFontCallback plf=%p\n", lpLogFont);
+    TRACE(win16drv, "In WineEnumDFontCallback plf=%p\n", lpLogFont);
     return (*(((WEPFC *)lpClientData)->proc))( lpLogFont, lpTextMetrics, 
 				     wFontType, ((WEPFC *)lpClientData)->lp );
 }
diff --git a/graphics/win16drv/graphics.c b/graphics/win16drv/graphics.c
index 63f34ab..433529e 100644
--- a/graphics/win16drv/graphics.c
+++ b/graphics/win16drv/graphics.c
@@ -60,9 +60,9 @@
     BOOL32 bRet = 0;
     POINT16 points[2];
 
-    dprintf_info(win16drv, "In WIN16DRV_Rectangle, x %d y %d DCOrgX %d y %d\n",
+    TRACE(win16drv, "In WIN16DRV_Rectangle, x %d y %d DCOrgX %d y %d\n",
            left, top, dc->w.DCOrgX, dc->w.DCOrgY);
-    dprintf_info(win16drv, "In WIN16DRV_Rectangle, VPortOrgX %d y %d\n",
+    TRACE(win16drv, "In WIN16DRV_Rectangle, VPortOrgX %d y %d\n",
            dc->vportOrgX, dc->vportOrgY);
     points[0].x = XLPTODP(dc, left);
     points[0].y = YLPTODP(dc, top);
@@ -152,9 +152,9 @@
     WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
     BOOL32 bRet = 0;
     POINT16 points[2];
-    dprintf_info(win16drv, "In WIN16DRV_Ellipse, x %d y %d DCOrgX %d y %d\n",
+    TRACE(win16drv, "In WIN16DRV_Ellipse, x %d y %d DCOrgX %d y %d\n",
            left, top, dc->w.DCOrgX, dc->w.DCOrgY);
-    dprintf_info(win16drv, "In WIN16DRV_Ellipse, VPortOrgX %d y %d\n",
+    TRACE(win16drv, "In WIN16DRV_Ellipse, VPortOrgX %d y %d\n",
            dc->vportOrgX, dc->vportOrgY);
     points[0].x = XLPTODP(dc, left);
     points[0].y = YLPTODP(dc, top);
diff --git a/graphics/win16drv/init.c b/graphics/win16drv/init.c
index 6703cf5..8b1a896 100644
--- a/graphics/win16drv/init.c
+++ b/graphics/win16drv/init.c
@@ -177,7 +177,7 @@
         return FALSE;
     }
 
-    dprintf_info(win16drv, "In creatdc for (%s,%s,%s) initData 0x%p\n",driver, device, output, initData);
+    TRACE(win16drv, "In creatdc for (%s,%s,%s) initData 0x%p\n",driver, device, output, initData);
 
     physDev = (WIN16DRV_PDEVICE *)HeapAlloc( SystemHeap, 0, sizeof(*physDev) );
     if (!physDev) return FALSE;
@@ -186,11 +186,11 @@
     pLPD = LoadPrinterDriver(driver);
     if (pLPD == NULL)
     {
-	dprintf_warn(win16drv, "LPGDI_CreateDC: Failed to find printer driver\n");
+	WARN(win16drv, "Failed to find printer driver\n");
         HeapFree( SystemHeap, 0, physDev );
         return FALSE;
     }
-    dprintf_info(win16drv, "windevCreateDC pLPD 0x%p\n", pLPD);
+    TRACE(win16drv, "windevCreateDC pLPD 0x%p\n", pLPD);
 
     /* Now Get the device capabilities from the printer driver */
     
@@ -226,7 +226,7 @@
     pPDH = (PDEVICE_HEADER *)((BYTE*)PTR_SEG_TO_LIN(physDev->segptrPDEVICE) - sizeof(PDEVICE_HEADER)); 
     pPDH->pLPD = pLPD;
     
-    dprintf_info(win16drv, "PRTDRV_Enable: PDEVICE allocated %08lx\n",(DWORD)(physDev->segptrPDEVICE));
+    TRACE(win16drv, "PDEVICE allocated %08lx\n",(DWORD)(physDev->segptrPDEVICE));
     
     /* Now get the printer driver to initialise this data */
     wRet = PRTDRV_Enable((LPVOID)physDev->segptrPDEVICE, INITPDEVICE, device, driver, output, NULL); 
@@ -538,7 +538,7 @@
     HANDLE16 hHandle = (HANDLE16)SP_ERROR;
     PPRINTJOB pPrintJob;
 
-    dprintf_info(win16drv, "OpenJob: \"%s\" \"%s\" %04x\n", lpOutput, lpTitle, hDC);
+    TRACE(win16drv, "\"%s\" \"%s\" %04x\n", lpOutput, lpTitle, hDC);
 
     pPrintJob = gPrintJobsTable[0];
     if (pPrintJob == NULL)
@@ -563,7 +563,7 @@
 	    gPrintJobsTable[pPrintJob->nIndex] = pPrintJob; 
 	}
     }
-    dprintf_info(win16drv, "OpenJob: return %04x\n", hHandle);
+    TRACE(win16drv, "return %04x\n", hHandle);
     return hHandle;
 }
 
@@ -572,7 +572,7 @@
     int nRet = SP_ERROR;
     PPRINTJOB pPrintJob = NULL;
 
-    dprintf_info(win16drv, "CloseJob: %04x\n", hJob);
+    TRACE(win16drv, "%04x\n", hJob);
 
     pPrintJob = FindPrintJobFromHandle(hJob);
     if (pPrintJob != NULL)
@@ -590,7 +590,7 @@
     int nRet = SP_ERROR;
     PPRINTJOB pPrintJob = NULL;
 
-    dprintf_info(win16drv, "WriteSpool: %04x %08lx %04x\n", hJob, (DWORD)lpData, cch);
+    TRACE(win16drv, "%04x %08lx %04x\n", hJob, (DWORD)lpData, cch);
 
     pPrintJob = FindPrintJobFromHandle(hJob);
     if (pPrintJob != NULL && pPrintJob->fd >= 0 && cch)
@@ -607,7 +607,7 @@
 {
     int nRet = 0;
 
-    dprintf_info(win16drv, "WriteDialog: %04x %04x \"%s\"\n", hJob,  cchMsg, lpMsg);
+    TRACE(win16drv, "%04x %04x '%s'\n", hJob,  cchMsg, lpMsg);
 
     nRet = MessageBox16(0, lpMsg, "Printing Error", MB_OKCANCEL);
     return nRet;
@@ -617,7 +617,7 @@
 {
     int nRet;
 
-    dprintf_info(win16drv, "DeleteJob: %04x\n", hJob);
+    TRACE(win16drv, "%04x\n", hJob);
 
     nRet = FreePrintJob(hJob);
     return nRet;
@@ -630,13 +630,13 @@
  */
 int WINAPI StartSpoolPage(HANDLE16 hJob)
 {
-    dprintf_fixme(win16drv, "StartSpoolPage GDI.246 unimplemented\n");
+    FIXME(win16drv, "StartSpoolPage GDI.246 unimplemented\n");
     return 1;
 
 }
 int WINAPI EndSpoolPage(HANDLE16 hJob)
 {
-    dprintf_fixme(win16drv, "EndSpoolPage GDI.247 unimplemented\n");
+    FIXME(win16drv, "EndSpoolPage GDI.247 unimplemented\n");
     return 1;
 }
 
@@ -644,6 +644,6 @@
 DWORD WINAPI GetSpoolJob(int nOption, LONG param)
 {
     DWORD retval = 0;
-    dprintf_info(win16drv, "In GetSpoolJob param 0x%lx noption %d\n",param, nOption);
+    TRACE(win16drv, "In GetSpoolJob param 0x%lx noption %d\n",param, nOption);
     return retval;
 }
diff --git a/graphics/win16drv/objects.c b/graphics/win16drv/objects.c
index a9a9e6e..709bd80 100644
--- a/graphics/win16drv/objects.c
+++ b/graphics/win16drv/objects.c
@@ -31,7 +31,7 @@
     HGDIOBJ32 ret = 0;
 
     if (!ptr) return 0;
-    dprintf_info(gdi, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle );
+    TRACE(gdi, "hdc=%04x %04x\n", dc->hSelf, handle );
     
     switch(ptr->wMagic)
     {
diff --git a/graphics/win16drv/pen.c b/graphics/win16drv/pen.c
index 459dcfe..8271f74 100644
--- a/graphics/win16drv/pen.c
+++ b/graphics/win16drv/pen.c
@@ -20,7 +20,7 @@
     int		 nSize;
     LOGPEN16 	 lPen16;
     dc->w.hPen = hpen;
-    dprintf_info(win16drv, "In WIN16DRV_PEN_SelectObject\n");
+    TRACE(win16drv, "In WIN16DRV_PEN_SelectObject\n");
     lPen16.lopnStyle   = pen->logpen.lopnStyle;
     lPen16.lopnWidth.x = pen->logpen.lopnWidth.x;
     lPen16.lopnWidth.y = pen->logpen.lopnWidth.y;
@@ -28,7 +28,7 @@
 
     if ( physDev->PenInfo )
     {
-        dprintf_info(win16drv, "UnRealizing PenInfo\n");
+        TRACE(win16drv, "UnRealizing PenInfo\n");
         nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_PEN,
 				      physDev->PenInfo,
 				      physDev->PenInfo, 0);
diff --git a/graphics/win16drv/prtdrv.c b/graphics/win16drv/prtdrv.c
index c686a0a..6968f09 100644
--- a/graphics/win16drv/prtdrv.c
+++ b/graphics/win16drv/prtdrv.c
@@ -55,7 +55,7 @@
       LoadPrinterDrvFunc(ADVANCEDSETUPDIALOG);
       LoadPrinterDrvFunc(DIALOGFN);
       LoadPrinterDrvFunc(PSEUDOEDIT);
-      dprintf_info(win16drv,"got func CONTROL 0x%p enable 0x%p enumDfonts 0x%p realizeobject 0x%p extextout 0x%p\n",
+      TRACE(win16drv,"got func CONTROL 0x%p enable 0x%p enumDfonts 0x%p realizeobject 0x%p extextout 0x%p\n",
               pLPD->fn[FUNC_CONTROL],
               pLPD->fn[FUNC_ENABLE],
               pLPD->fn[FUNC_ENUMDFONTS],
@@ -78,7 +78,7 @@
 	ptmpLPD = gapLoadedPrinterDrivers[nDriverSlot++];
 	if (ptmpLPD != NULL)
 	{
-	    dprintf_info(win16drv, "Comparing %s,%s\n",ptmpLPD->szDriver,pszDriver);
+	    TRACE(win16drv, "Comparing %s,%s\n",ptmpLPD->szDriver,pszDriver);
 	    /* Found driver store info, exit loop */
 	    if (lstrcmpi32A(ptmpLPD->szDriver, pszDriver) == 0)
 	      pLPD = ptmpLPD;
@@ -150,7 +150,7 @@
 	/* Failed to load driver */
 	fprintf(stderr, "Failed to load printer driver %s\n", pszDriver);
     } else {
-        dprintf_info(win16drv, "Loaded the library\n");
+        TRACE(win16drv, "Loaded the library\n");
 	/* Allocate some memory for printer driver info */
 	pLPD = malloc(sizeof(LOADED_PRINTER_DRIVER));
 	memset(pLPD, 0 , sizeof(LOADED_PRINTER_DRIVER));
@@ -161,7 +161,7 @@
 	/* Get DS for the printer module */
 	pLPD->ds_reg	= hInst;
 
-	dprintf_info(win16drv, "DS for %s is %x\n", pszDriver, pLPD->ds_reg);
+	TRACE(win16drv, "DS for %s is %x\n", pszDriver, pLPD->ds_reg);
 
 	/* Get address of printer driver functions */
 	GetPrinterDriverFunctions(hInst, pLPD);
@@ -188,20 +188,20 @@
     WORD wRet = 0;
     LOADED_PRINTER_DRIVER *pLPD = NULL;
 
-    dprintf_info(win16drv, "PRTDRV_Control: %08x 0x%x %08lx %08lx\n", (unsigned int)lpDestDev, wfunction, lpInData, lpOutData);
+    TRACE(win16drv, "%08x 0x%x %08lx %08lx\n", (unsigned int)lpDestDev, wfunction, lpInData, lpOutData);
 
     if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
     {
 	if (pLPD->fn[FUNC_CONTROL] == NULL)
 	{
-	    dprintf_warn(win16drv, "PRTDRV_Control: Not supported by driver\n");
+	    WARN(win16drv, "Not supported by driver\n");
 	    return 0;
 	}
 	wRet = Callbacks->CallDrvControlProc( pLPD->fn[FUNC_CONTROL], 
                                               (SEGPTR)lpDestDev, wfunction,
                                               lpInData, lpOutData );
     }
-    dprintf_info(win16drv, "PRTDRV_Control: return %x\n", wRet);
+    TRACE(win16drv, "return %x\n", wRet);
     return wRet;
 }
 
@@ -214,7 +214,7 @@
     WORD wRet = 0;
     LOADED_PRINTER_DRIVER *pLPD = NULL;
 
-    dprintf_info(win16drv, "PRTDRV_Enable: %s %s\n",lpDestDevType, lpOutputFile);
+    TRACE(win16drv, "%s %s\n",lpDestDevType, lpOutputFile);
 
     /* Get the printer driver info */
     if (wStyle == INITPDEVICE)
@@ -228,7 +228,7 @@
 	WORD		wP2;
 
 	if (!pLPD->fn[FUNC_ENABLE]) {
-	    dprintf_warn(win16drv, "PRTDRV_Enable: Not supported by driver\n");
+	    WARN(win16drv, "Not supported by driver\n");
 	    return 0;
 	}
 
@@ -259,7 +259,7 @@
 	    SEGPTR_FREE(lP1);
 	}
     }
-    dprintf_info(win16drv, "PRTDRV_Enable: return %x\n", wRet);
+    TRACE(win16drv, "return %x\n", wRet);
     return wRet;
 }
 
@@ -273,7 +273,7 @@
     WORD wRet = 0;
     LOADED_PRINTER_DRIVER *pLPD = NULL;
 
-    dprintf_info(win16drv, "PRTDRV_EnumDFonts: %08lx %s %p %p\n",
+    TRACE(win16drv, "%08lx %s %p %p\n",
 		     lpDestDev, lpFaceName, lpCallbackFunc, lpClientData);
 
     if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
@@ -282,7 +282,7 @@
 	LPBYTE lP2;
 
 	if (pLPD->fn[FUNC_ENUMDFONTS] == NULL) {
-	    dprintf_warn(win16drv, "PRTDRV_EnumDFonts: Not supported by driver\n");
+	    WARN(win16drv, "Not supported by driver\n");
 	    return 0;
 	}
 
@@ -299,7 +299,7 @@
     } else 
         fprintf(stderr,"Failed to find device\n");
     
-    dprintf_info(win16drv, "PRTDRV_EnumDFonts: return %x\n", wRet);
+    TRACE(win16drv, "return %x\n", wRet);
     return wRet;
 }
 /*
@@ -311,7 +311,7 @@
     WORD wRet = 0;
     LOADED_PRINTER_DRIVER *pLPD = NULL;
 
-    dprintf_info(win16drv, "PRTDRV_EnumObj:\n");
+    TRACE(win16drv, "(some params - fixme)\n");
 
     if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
     {
@@ -321,7 +321,7 @@
 
 	if (pLPD->fn[FUNC_ENUMOBJ] == NULL)
 	{
-	    dprintf_warn(win16drv, "PRTDRV_EnumObj: Not supported by driver\n");
+	    WARN(win16drv, "Not supported by driver\n");
 	    return 0;
 	}
 
@@ -342,7 +342,7 @@
     else 
         fprintf(stderr,"Failed to find device\n");
     
-    dprintf_info(win16drv, "PRTDRV_EnumObj: return %x\n", wRet);
+    TRACE(win16drv, "return %x\n", wRet);
     return wRet;
 }
 
@@ -361,7 +361,7 @@
     WORD wRet = 0;
     LOADED_PRINTER_DRIVER *pLPD = NULL;
     
-    dprintf_info(win16drv, "PRTDRV_OUTPUT %d\n", wStyle );
+    TRACE(win16drv, "PRTDRV_OUTPUT %d\n", wStyle );
     
     if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
     {
@@ -372,7 +372,7 @@
 	int   nSize;
 	if (pLPD->fn[FUNC_OUTPUT] == NULL)
 	{
-	    dprintf_warn(win16drv, "PRTDRV_Output: Not supported by driver\n");
+	    WARN(win16drv, "Not supported by driver\n");
 	    return 0;
 	}
 
@@ -415,7 +415,7 @@
 	        {
 		    CONV_RECT32TO16( pRect, lP8 );
 
-		    dprintf_info(win16drv, "rect = %d,%d - %d,%d\n",
+		    TRACE(win16drv, "rect = %d,%d - %d,%d\n",
 			    lP8->left, lP8->top, lP8->right, lP8->bottom );
 		    wRet = Callbacks->CallDrvOutputProc(pLPD->fn[FUNC_OUTPUT], 
                                             lP1, wP2, wP3, SEGPTR_GET(lP4),
@@ -433,7 +433,7 @@
 	}
         SEGPTR_FREE(lP4);
     }
-    dprintf_info(win16drv, "PRTDRV_Output return %d\n", wRet);
+    TRACE(win16drv, "PRTDRV_Output return %d\n", wRet);
     return wRet;
 }
 
@@ -447,9 +447,8 @@
     WORD dwRet = 0;
     LOADED_PRINTER_DRIVER *pLPD = NULL;
     
-    dprintf_info(win16drv,
-		     "PRTDRV_RealizeObject: %08lx %04x %p %p %08lx\n",
-		     lpDestDev, wStyle, lpInObj, lpOutObj, lpTextXForm);
+    TRACE(win16drv, "%08lx %04x %p %p %08lx\n",
+		 lpDestDev, wStyle, lpInObj, lpOutObj, lpTextXForm);
     
     if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
     {
@@ -460,8 +459,7 @@
 
 	if (pLPD->fn[FUNC_REALIZEOBJECT] == NULL)
 	{
-	    dprintf_warn(win16drv,
-			    "PRTDRV_RealizeObject: Not supported by driver\n");
+	    WARN(win16drv, "Not supported by driver\n");
 	    return 0;
 	}
 
@@ -506,16 +504,15 @@
 	lP4 = SEGPTR_GET( lpOutObj );
 
         lP5 = lpTextXForm;
-	dprintf_info(win16drv,
-			 "Calling Realize %08lx %04x %08lx %08lx %08lx\n",
-	                                      lP1, wP2, lP3, lP4, lP5);
+	TRACE(win16drv, "Calling Realize %08lx %04x %08lx %08lx %08lx\n",
+		     lP1, wP2, lP3, lP4, lP5);
 	dwRet = Callbacks->CallDrvRealizeProc(pLPD->fn[FUNC_REALIZEOBJECT], 
                                               lP1, wP2, lP3, lP4, lP5);
 	if(lpBuf)
 	    SEGPTR_FREE(lpBuf);
 
     }
-    dprintf_info(win16drv, "PRTDRV_RealizeObject: return %x\n", dwRet);
+    TRACE(win16drv, "return %x\n", dwRet);
     return dwRet;
 }
 
@@ -536,7 +533,7 @@
     WORD wRet = 0;
     LOADED_PRINTER_DRIVER *pLPD = NULL;
     
-    dprintf_info(win16drv, "PRTDRV_StretchBlt:\n");
+    TRACE(win16drv, "(lots of params - fixme)\n");
     
     if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
     {
@@ -546,7 +543,7 @@
 
 	if (pLPD->fn[FUNC_STRETCHBLT] == NULL)
 	{
-	    dprintf_warn(win16drv, "PRTDRV_StretchBlt: Not supported by driver\n");
+	    WARN(win16drv, "Not supported by driver\n");
 	    return 0;
 	}
 	lP1  = lpDestDev;
@@ -590,7 +587,7 @@
     DWORD dwRet = 0;
     LOADED_PRINTER_DRIVER *pLPD = NULL;
     
-    dprintf_info(win16drv, "PRTDRV_ExtTextOut:\n");
+    TRACE(win16drv, "(lots of params - fixme)\n");
     
     if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
     {
@@ -603,7 +600,7 @@
 
 	if (pLPD->fn[FUNC_EXTTEXTOUT] == NULL)
 	{
-	    dprintf_warn(win16drv, "PRTDRV_ExtTextOut: Not supported by driver\n");
+	    WARN(win16drv, "Not supported by driver\n");
 	    return 0;
 	}
 
@@ -613,7 +610,7 @@
 	
 	if (lpClipRect != NULL) {
 	    lP4 = SEGPTR_NEW(RECT16);
-            dprintf_info(win16drv, "Adding lpClipRect\n");
+            TRACE(win16drv, "Adding lpClipRect\n");
 	    memcpy(lP4,lpClipRect,sizeof(RECT16));
 	} else
 	  lP4 = 0L;
@@ -623,7 +620,7 @@
 	    if (nSize>abs(wCount))
 	    	nSize = abs(wCount);
 	    lP5 = SEGPTR_ALLOC(nSize+1);
-            dprintf_info(win16drv, "Adding lpString (nSize is %d)\n",nSize);
+            TRACE(win16drv, "Adding lpString (nSize is %d)\n",nSize);
 	    memcpy(lP5,lpString,nSize);
 	    *((char *)lP5 + nSize) = '\0';
 	} else
@@ -637,21 +634,23 @@
         lP9 = lpTextXForm;
 	
 	if (lpCharWidths != NULL) 
-	  dprintf_fixme(win16drv, "PRTDRV_ExtTextOut: Char widths not supported\n");
+	  FIXME(win16drv, "Char widths not supported\n");
 	lP10 = 0;
 	
 	if (lpOpaqueRect != NULL) {
 	    lP11 = SEGPTR_NEW(RECT16);
-            dprintf_info(win16drv, "Adding lpOpaqueRect\n");
+            TRACE(win16drv, "Adding lpOpaqueRect\n");
 	    memcpy(lP11,lpOpaqueRect,sizeof(RECT16));	
 	} else
 	  lP11 = 0L;
 	
 	wP12 = wOptions;
-	dprintf_info(win16drv, "Calling ExtTextOut 0x%lx 0x%x 0x%x %p\n%*s 0x%x 0x%lx 0x%lx\n"
-               "0x%lx 0x%lx %p 0x%x\n",lP1, wP2, wP3, lP4, 
-					   nSize,lP5, iP6, lP7, lP8, lP9, lP10,
-					   lP11, wP12);
+	TRACE(win16drv, "Calling ExtTextOut 0x%lx 0x%x 0x%x %p\n",
+		     lP1, wP2, wP3, lP4);
+        TRACE(win16drv, "%*s 0x%x 0x%lx 0x%lx\n",
+		     nSize,lP5, iP6, lP7, lP8);
+        TRACE(win16drv, "0x%lx 0x%lx %p 0x%x\n",
+		     lP9, lP10, lP11, wP12);
 	dwRet = Callbacks->CallDrvExtTextOutProc(pLPD->fn[FUNC_EXTTEXTOUT], 
                                                  lP1, wP2, wP3,
                                                  SEGPTR_GET(lP4),
@@ -659,7 +658,7 @@
                                                  lP8, lP9, lP10,
                                                  SEGPTR_GET(lP11), wP12);
     }
-    dprintf_info(win16drv, "PRTDRV_ExtTextOut: return %lx\n", dwRet);
+    TRACE(win16drv, "return %lx\n", dwRet);
     return dwRet;
 }
 
@@ -756,7 +755,7 @@
     WORD wRet = 0;
     LOADED_PRINTER_DRIVER *pLPD = NULL;
     
-    dprintf_info(win16drv, "PRTDRV_GetCharWidth:\n");
+    TRACE(win16drv, "(lots of params - fixme)\n");
     
     if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
     {
@@ -766,8 +765,7 @@
 	
 	if (pLPD->fn[FUNC_GETCHARWIDTH] == NULL)
 	{
-	    dprintf_warn(win16drv,
-		"PRTDRV_GetCharWidth: Not supported by driver\n");
+	    WARN(win16drv, "Not supported by driver\n");
 	    return 0;
 	}
 
diff --git a/graphics/win16drv/text.c b/graphics/win16drv/text.c
index 2bbd2aa..609ecaf 100644
--- a/graphics/win16drv/text.c
+++ b/graphics/win16drv/text.c
@@ -31,7 +31,7 @@
     if (count == 0)
       return FALSE;
 
-    dprintf_info(win16drv, "WIN16DRV_ExtTextOut: %04x %d %d %x %p %*s %p\n",
+    TRACE(win16drv, "%04x %d %d %x %p %*s %p\n",
 	   dc->hSelf, x, y, flags,  lprect, count > 0 ? count : 8, str, lpDx);
 
 
@@ -54,7 +54,7 @@
             
         }
         
-	dprintf_info(win16drv, "textalign = %d\n", dc->w.textAlign);
+	TRACE(win16drv, "textalign = %d\n", dc->w.textAlign);
 
 	if (dc->w.textAlign & TA_UPDATECP)
 	{
diff --git a/graphics/x11drv/bitblt.c b/graphics/x11drv/bitblt.c
index d71cefb..de68103 100644
--- a/graphics/x11drv/bitblt.c
+++ b/graphics/x11drv/bitblt.c
@@ -1119,12 +1119,12 @@
     widthDst  = widthDst * dcDst->vportExtX / dcDst->wndExtX;
     heightDst = heightDst * dcDst->vportExtY / dcDst->wndExtY;
 
-    dprintf_info(bitblt, "    vportdst=%d,%d-%d,%d wnddst=%d,%d-%d,%d\n",
+    TRACE(bitblt, "    vportdst=%d,%d-%d,%d wnddst=%d,%d-%d,%d\n",
                     dcDst->vportOrgX, dcDst->vportOrgY,
                     dcDst->vportExtX, dcDst->vportExtY,
                     dcDst->wndOrgX, dcDst->wndOrgY,
                     dcDst->wndExtX, dcDst->wndExtY );
-    dprintf_info(bitblt, "    rectdst=%d,%d-%d,%d orgdst=%d,%d\n",
+    TRACE(bitblt, "    rectdst=%d,%d-%d,%d orgdst=%d,%d\n",
                     xDst, yDst, widthDst, heightDst,
                     dcDst->w.DCOrgX, dcDst->w.DCOrgY );
 
@@ -1135,19 +1135,19 @@
         widthSrc  = widthSrc * dcSrc->vportExtX / dcSrc->wndExtX;
         heightSrc = heightSrc * dcSrc->vportExtY / dcSrc->wndExtY;
         fStretch  = (widthSrc != widthDst) || (heightSrc != heightDst);
-        dprintf_info(bitblt,"    vportsrc=%d,%d-%d,%d wndsrc=%d,%d-%d,%d\n",
+        TRACE(bitblt,"    vportsrc=%d,%d-%d,%d wndsrc=%d,%d-%d,%d\n",
                         dcSrc->vportOrgX, dcSrc->vportOrgY,
                         dcSrc->vportExtX, dcSrc->vportExtY,
                         dcSrc->wndOrgX, dcSrc->wndOrgY,
                         dcSrc->wndExtX, dcSrc->wndExtY );
-        dprintf_info(bitblt, "    rectsrc=%d,%d-%d,%d orgsrc=%d,%d\n",
+        TRACE(bitblt, "    rectsrc=%d,%d-%d,%d orgsrc=%d,%d\n",
                         xSrc, ySrc, widthSrc, heightSrc,
                         dcSrc->w.DCOrgX, dcSrc->w.DCOrgY );
         if (!BITBLT_GetVisRectangles( dcDst, xDst, yDst, widthDst, heightDst,
                                       dcSrc, xSrc, ySrc, widthSrc, heightSrc,
                                       &visRectSrc, &visRectDst ))
             return TRUE;
-        dprintf_info(bitblt, "    vissrc=%d,%d-%d,%d visdst=%d,%d-%d,%d\n",
+        TRACE(bitblt, "    vissrc=%d,%d-%d,%d visdst=%d,%d-%d,%d\n",
                         visRectSrc.left, visRectSrc.top,
                         visRectSrc.right, visRectSrc.bottom,
                         visRectDst.left, visRectDst.top,
@@ -1159,7 +1159,7 @@
         if (!BITBLT_GetVisRectangles( dcDst, xDst, yDst, widthDst, heightDst,
                                       NULL, 0, 0, 0, 0, NULL, &visRectDst ))
             return TRUE;
-        dprintf_info(bitblt, "    vissrc=none visdst=%d,%d-%d,%d\n",
+        TRACE(bitblt, "    vissrc=none visdst=%d,%d-%d,%d\n",
                         visRectDst.left, visRectDst.top,
                         visRectDst.right, visRectDst.bottom );
     }
diff --git a/graphics/x11drv/brush.c b/graphics/x11drv/brush.c
index 90ff60a..786d8b2 100644
--- a/graphics/x11drv/brush.c
+++ b/graphics/x11drv/brush.c
@@ -208,7 +208,7 @@
     BITMAPINFO * bmpInfo;
     HBRUSH16 prevHandle = dc->w.hBrush;
 
-    dprintf_info(gdi, "Brush_SelectObject: hdc=%04x hbrush=%04x\n",
+    TRACE(gdi, "hdc=%04x hbrush=%04x\n",
                 dc->hSelf,hbrush);
 #ifdef NOTDEF
     if (dc->header.wMagic == METAFILE_DC_MAGIC)
@@ -243,16 +243,16 @@
     switch(brush->logbrush.lbStyle)
     {
       case BS_NULL:
-	dprintf_info(gdi,"BS_NULL\n" );
+	TRACE(gdi,"BS_NULL\n" );
 	break;
 
       case BS_SOLID:
-        dprintf_info(gdi,"BS_SOLID\n" );
+        TRACE(gdi,"BS_SOLID\n" );
 	BRUSH_SelectSolidBrush( dc, brush->logbrush.lbColor );
 	break;
 	
       case BS_HATCHED:
-	dprintf_info(gdi, "BS_HATCHED\n" );
+	TRACE(gdi, "BS_HATCHED\n" );
 	dc->u.x.brush.pixel = COLOR_ToPhysical( dc, brush->logbrush.lbColor );
 	dc->u.x.brush.pixmap = TSXCreateBitmapFromData( display, rootWindow,
 				 HatchBrushes[brush->logbrush.lbHatch], 8, 8 );
@@ -260,12 +260,12 @@
 	break;
 	
       case BS_PATTERN:
-	dprintf_info(gdi, "BS_PATTERN\n");
+	TRACE(gdi, "BS_PATTERN\n");
 	BRUSH_SelectPatternBrush( dc, (HBRUSH16)brush->logbrush.lbHatch );
 	break;
 
       case BS_DIBPATTERN:
-	dprintf_info(gdi, "BS_DIBPATTERN\n");
+	TRACE(gdi, "BS_DIBPATTERN\n");
 	if ((bmpInfo = (BITMAPINFO *) GlobalLock16( (HGLOBAL16)brush->logbrush.lbHatch )))
 	{
 	    int size = DIB_BitmapInfoSize( bmpInfo, brush->logbrush.lbColor );
diff --git a/graphics/x11drv/graphics.c b/graphics/x11drv/graphics.c
index 091829e..083c6ba 100644
--- a/graphics/x11drv/graphics.c
+++ b/graphics/x11drv/graphics.c
@@ -270,7 +270,7 @@
 X11DRV_RoundRect( DC *dc, INT32 left, INT32 top, INT32 right,
                   INT32 bottom, INT32 ell_width, INT32 ell_height )
 {
-    dprintf_info(graphics, "X11DRV_RoundRect(%d %d %d %d  %d %d\n", 
+    TRACE(graphics, "(%d %d %d %d  %d %d\n", 
     	left, top, right, bottom, ell_width, ell_height);
 
     left   = XLPTODP( dc, left );
@@ -694,7 +694,7 @@
     BOOL32 result;
     struct FloodFill_params params = { dc, x, y, color, fillType };
 
-    dprintf_info(graphics, "X11DRV_ExtFloodFill %d,%d %06lx %d\n",
+    TRACE(graphics, "X11DRV_ExtFloodFill %d,%d %06lx %d\n",
                       x, y, color, fillType );
 
     if (!PtVisible32( dc->hSelf, x, y )) return FALSE;
diff --git a/graphics/x11drv/objects.c b/graphics/x11drv/objects.c
index 1a8fa7e..8fc77bd 100644
--- a/graphics/x11drv/objects.c
+++ b/graphics/x11drv/objects.c
@@ -31,7 +31,7 @@
     HGDIOBJ32 ret = 0;
 
     if (!ptr) return 0;
-    dprintf_info(gdi, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle );
+    TRACE(gdi, "hdc=%04x %04x\n", dc->hSelf, handle );
     
     switch(ptr->wMagic)
     {
diff --git a/graphics/x11drv/text.c b/graphics/x11drv/text.c
index a206860..a056d95 100644
--- a/graphics/x11drv/text.c
+++ b/graphics/x11drv/text.c
@@ -43,10 +43,10 @@
     lfUnderline = (pfo->fo_flags & FO_SYNTH_UNDERLINE) ? 1 : 0;
     lfStrikeOut = (pfo->fo_flags & FO_SYNTH_STRIKEOUT) ? 1 : 0;
 
-    dprintf_info(text,"ExtTextOut: hdc=%04x df=%04x %d,%d '%.*s', %d  flags=%d\n",
+    TRACE(text,"hdc=%04x df=%04x %d,%d '%.*s', %d  flags=%d\n",
                  dc->hSelf, (UINT16)(dc->u.x.font), x, y, (int)count, str, count, flags);
 
-    if (lprect != NULL) dprintf_info(text, "\trect=(%d,%d- %d,%d)\n",
+    if (lprect != NULL) TRACE(text, "\trect=(%d,%d- %d,%d)\n",
                                      lprect->left, lprect->top,
                                      lprect->right, lprect->bottom );
       /* Setup coordinates */
@@ -85,7 +85,7 @@
     x = XLPTODP( dc, x );
     y = YLPTODP( dc, y );
 
-    dprintf_info(text,"\treal coord: x=%i, y=%i, rect=(%d,%d-%d,%d)\n",
+    TRACE(text,"\treal coord: x=%i, y=%i, rect=(%d,%d-%d,%d)\n",
 			  x, y, rect.left, rect.top, rect.right, rect.bottom);
 
       /* Draw the rectangle */
diff --git a/graphics/x11drv/xfont.c b/graphics/x11drv/xfont.c
index 756bfc2..561fc9e 100644
--- a/graphics/x11drv/xfont.c
+++ b/graphics/x11drv/xfont.c
@@ -523,7 +523,7 @@
 	    sprintf( lpch, "%i-*-*-*-*-*-%s*", fo->fi->lfd_height, lpEncoding );
    }
 
-   dprintf_info(font,"\tLFD: %s\n", lpLFD );
+   TRACE(font,"\tLFD: %s\n", lpLFD );
    return TRUE;
 }
 
@@ -825,7 +825,7 @@
 	}
 
 #ifdef DEBUG_FONT_INIT
-	dprintf_info(font,"typeface \'%s\'\n", fr->lfFaceName);
+	TRACE(font,"typeface \'%s\'\n", fr->lfFaceName);
 #endif
 	fr->fr_flags |= FR_NAMESET;
     }
@@ -866,7 +866,7 @@
 	if( !lstrcmpi32A( pfa->faTypeFace, lpAlias ) )
 	{
 #ifdef DEBUG_FONT_INIT
-	    dprintf_info(font,"\tredundant alias '%s' -> '%s'\n", lpAlias, lpTypeFace );
+	    TRACE(font,"\tredundant alias '%s' -> '%s'\n", lpAlias, lpTypeFace );
 #endif
 	    return NULL;
 	} 
@@ -886,7 +886,7 @@
         lstrcpy32A( pfa->faAlias, lpAlias );
 
 #ifdef DEBUG_FONT_INIT
-        dprintf_info(font, "\tadded alias '%s' for %s\n", lpAlias, lpTypeFace );
+        TRACE(font, "\tadded alias '%s' for %s\n", lpAlias, lpTypeFace );
 #endif
 	return pfa;
     }
@@ -988,7 +988,7 @@
 			}
 						
 #ifdef DEBUG_FONT_INIT
-                        dprintf_info(font, "\tsubstituted '%s' with %s\n",
+                        TRACE(font, "\tsubstituted '%s' with %s\n",
 						frMatch->lfFaceName, lpAlias );
 #endif
 			lstrcpyn32A( frMatch->lfFaceName, lpAlias, LF_FACESIZE );
@@ -1062,7 +1062,7 @@
 		    fontResource* 	pfr = fontList;
 		    fontInfo* 		pfi = NULL;
 
-		    dprintf_info(font,"Reading cached font metrics:\n");
+		    TRACE(font,"Reading cached font metrics:\n");
 
 		    read( fd, fontList, i); /* read all metrics at once */
 		    while( offset < length )
@@ -1102,7 +1102,7 @@
 			offset += sizeof(int);
 			for( pfr = fontList; pfr; pfr = pfr->next )
 			{
-			    dprintf_info(font,"\t%s, %i instances\n", lpch, pfr->count );
+			    TRACE(font,"\t%s, %i instances\n", lpch, pfr->count );
 			    pfr->resource = lpch;
 			    while( TRUE )
 			    { 
@@ -1158,13 +1158,13 @@
         i += n_ff * sizeof(fontResource) + j * sizeof(fontInfo) + sizeof(int);
 	write( fd, &i, sizeof(int) );
 
-	dprintf_info(font,"Writing font cache:\n");
+	TRACE(font,"Writing font cache:\n");
 
 	for( pfr = fontList; pfr; pfr = pfr->next )
 	{
 	    fontInfo fi;
 
-	    dprintf_info(font,"\t%s, %i instances\n", pfr->resource, pfr->count );
+	    TRACE(font,"\t%s, %i instances\n", pfr->resource, pfr->count );
 
 	    i = write( fd, pfr, sizeof(fontResource) );
 	    if( i == sizeof(fontResource) ) 
@@ -1323,7 +1323,7 @@
       
   x_pattern = TSXListFonts(display, "*", MAX_FONT_FAMILIES * 16, &x_count );
 
-  dprintf_info(font,"Font Mapper: initializing %i fonts [LPY=%i, XDR=%i, DR=%i]\n", 
+  TRACE(font,"Font Mapper: initializing %i fonts [LPY=%i, XDR=%i, DR=%i]\n", 
 				    x_count, pDevCaps->logPixelsY, DefResolution, res);
   for( i = x_checksum = 0; i < x_count; i++ )
   {
@@ -1396,7 +1396,7 @@
 	   lstrcpyn32A( fr->resource, typeface, j + 1 );
 
 #ifdef DEBUG_FONT_INIT
-	   dprintf_info(font,"    family: %s\n", fr->resource );
+	   TRACE(font,"    family: %s\n", fr->resource );
 #endif
 
 	   if( pfr ) pfr->next = fr;
@@ -1440,7 +1440,7 @@
            TSXFreeFont( display, x_fs );
 
 #ifdef DEBUG_FONT_INIT
-	   dprintf_info(font,"\t[% 2ipt] '%s'\n", fi->df.dfPoints, typeface );
+	   TRACE(font,"\t[% 2ipt] '%s'\n", fi->df.dfPoints, typeface );
 #endif
 	   XFONT_CheckFIList( fr, fi, REMOVE_SUBSETS );
 	   fi = NULL;	/* preventing reuse */
@@ -1485,7 +1485,7 @@
   XFONT_GrowFreeList(0, fontCacheSize - 1);
 
 #ifdef DEBUG_FONT_INIT
-        dprintf_info(font,"done!\n");
+        TRACE(font,"done!\n");
 #endif
 
   /* update text caps parameter */
@@ -1549,7 +1549,7 @@
    BOOL32       bScale = pfi->fi_flags & FI_SCALABLE;
    INT32        d, h;
 
-   dprintf_info(font,"\t[ %-2ipt h=%-3i w=%-3i %s%s]\n", pfi->df.dfPoints,
+   TRACE(font,"\t[ %-2ipt h=%-3i w=%-3i %s%s]\n", pfi->df.dfPoints,
 		 pfi->df.dfPixHeight, pfi->df.dfAvgWidth,
 		(pfi->df.dfWeight > 400) ? "Bold " : "Normal ",
 		(pfi->df.dfItalic) ? "Italic" : "" );
@@ -1639,7 +1639,7 @@
    if( penalty && pfi->lfd_resolution != DefResolution ) 
        penalty++;
 
-   dprintf_info(font,"  returning %i\n", penalty );
+   TRACE(font,"  returning %i\n", penalty );
 
    return penalty;
 }
@@ -1717,7 +1717,7 @@
   }
 
 #ifdef DEBUG_FONT_INIT
-  if( i ) dprintf_info(font,"\t    purged %i subsets [%i]\n", i , fr->count);
+  if( i ) TRACE(font,"\t    purged %i subsets [%i]\n", i , fr->count);
 #endif
 }
 
@@ -1760,7 +1760,7 @@
 
     if( fm.pfr )        /* match family */
     {
-	dprintf_info(font, "%s\n", fm.pfr->lfFaceName );
+	TRACE(font, "%s\n", fm.pfr->lfFaceName );
 
         XFONT_MatchFIList( &fm );
         *pfm = fm;
@@ -1774,7 +1774,7 @@
         for( start = fontList; start && score; start = start->next )
         {
             fm.pfr = start;
-	    dprintf_info(font, "%s\n", fm.pfr->lfFaceName );
+	    TRACE(font, "%s\n", fm.pfr->lfFaceName );
 
             current_score = XFONT_MatchFIList( &fm );
             if( current_score < score )
@@ -1849,7 +1849,7 @@
     {
 	int	prev_i, prev_j, j;
 
-	dprintf_info(font,"font cache is full\n");
+	TRACE(font,"font cache is full\n");
 
 	/* lookup the least recently used font */
 
@@ -1868,7 +1868,7 @@
 	{
 	    /* detach from the lru list */
 
-	    dprintf_info(font,"\tfreeing entry %i\n", j );
+	    TRACE(font,"\tfreeing entry %i\n", j );
 
 	    if( prev_j >= 0 )
 		fontCache[prev_j].lru = fontCache[j].lru;
@@ -1886,7 +1886,7 @@
 
 	    prev_i = fontCacheSize + FONTCACHE;
 
-	    dprintf_info(font,"\tgrowing font cache from %i to %i\n", fontCacheSize, prev_i );
+	    TRACE(font,"\tgrowing font cache from %i to %i\n", fontCacheSize, prev_i );
 
 	    if( (newCache = (fontObject*)HeapReAlloc(SystemHeap, 0,  
 						     fontCache, prev_i)) )
@@ -1941,9 +1941,9 @@
 	    {
 		UINT32	uRelaxLevel = 0;
 
-		dprintf_info(font,"XRealizeFont: (%u) '%s' h=%i weight=%i %s\n",
-				     plf->lfCharSet, plf->lfFaceName, plf->lfHeight, 
-				     plf->lfWeight, (plf->lfItalic) ? "Italic" : "" );
+		TRACE(font,"(%u) '%s' h=%i weight=%i %s\n",
+			     plf->lfCharSet, plf->lfFaceName, plf->lfHeight, 
+			     plf->lfWeight, (plf->lfItalic) ? "Italic" : "" );
 
 		XFONT_MatchDeviceFont( fontList, &fm );
 
@@ -2019,7 +2019,7 @@
     pfo->lru = fontMRU;
     fontMRU = (pfo - fontCache);
 
-    dprintf_info(font,"physfont %i\n", fontMRU);
+    TRACE(font,"physfont %i\n", fontMRU);
 
     return (X_PHYSFONT)(X_PFONT_MAGIC | fontMRU);
 }
diff --git a/if1632/Makefile.in b/if1632/Makefile.in
index 26e1e7a..9e9fe8f 100644
--- a/if1632/Makefile.in
+++ b/if1632/Makefile.in
@@ -29,6 +29,7 @@
 	stress.spec \
 	system.spec \
 	toolhelp.spec \
+	typelib.spec \
 	user.spec \
 	ver.spec \
 	w32sys.spec \
diff --git a/if1632/builtin.c b/if1632/builtin.c
index e56183d..905c982 100644
--- a/if1632/builtin.c
+++ b/if1632/builtin.c
@@ -67,6 +67,7 @@
 extern const WIN16_DESCRIPTOR STRESS_Descriptor;
 extern const WIN16_DESCRIPTOR SYSTEM_Descriptor;
 extern const WIN16_DESCRIPTOR TOOLHELP_Descriptor;
+extern const WIN16_DESCRIPTOR TYPELIB_Descriptor;
 extern const WIN16_DESCRIPTOR USER_Descriptor;
 extern const WIN16_DESCRIPTOR VER_Descriptor;
 extern const WIN16_DESCRIPTOR W32SYS_Descriptor;
@@ -108,6 +109,7 @@
     { &STORAGE_Descriptor,  DLL_FLAG_NOT_USED },
     { &STRESS_Descriptor,   0 },
     { &TOOLHELP_Descriptor, 0 },
+    { &TYPELIB_Descriptor,  0 },
     { &VER_Descriptor,      0 },
     { &W32SYS_Descriptor,   0 },
     { &WIN32S16_Descriptor, 0 },
@@ -141,7 +143,7 @@
     if (!hModule) return 0;
     FarSetOwner( hModule, hModule );
 
-    dprintf_info(module, "Built-in %s: hmodule=%04x\n",
+    TRACE(module, "Built-in %s: hmodule=%04x\n",
                     descr->name, hModule );
     pModule = (NE_MODULE *)GlobalLock16( hModule );
     pModule->self = hModule;
diff --git a/if1632/compobj.spec b/if1632/compobj.spec
index f0ce3c9..d37bbef 100644
--- a/if1632/compobj.spec
+++ b/if1632/compobj.spec
@@ -34,7 +34,7 @@
 31 pascal CoDosDateTimeToFileTime(word word ptr) DosDateTimeToFileTime
 32 stub COMARSHALHRESULT
 33 stub COUNMARSHALHRESULT
-34 stub COGETCURRENTPROCESS
+34 pascal CoGetCurrentProcess() CoGetCurrentProcess
 #35 ___EXPORTEDSTUB
 36 stub COISOLE1CLASS
 37 stub _GUID_NULL
@@ -63,7 +63,7 @@
 60 stub _IID_IMESSAGEFILTER
 61 pascal CLSIDFromProgID(str ptr) CLSIDFromProgID16
 62 stub PROGIDFROMCLSID
-63 stub COLOCKOBJECTEXTERNAL
+63 pascal CoLockObjectExternal(segptr word word) CoLockObjectExternal16
 64 stub _CLSID_STDMARSHAL
 65 stub COGETTREATASCLASS
 66 stub COTREATASCLASS
@@ -75,7 +75,7 @@
 72 stub _IID_IEXTERNALCONNECTION
 73 stub COCREATEGUID
 75 stub FNASSERT
-76 stub STRINGFROMGUID2
+76 pascal STRINGFROMGUID2(ptr ptr word) StringFromGUID2
 77 stub COGETCLASSEXT
 78 stub OLE1CLASSFROMCLSID2
 79 stub CLSIDFROMOLE1CLASS
diff --git a/if1632/kernel.spec b/if1632/kernel.spec
index abb0bff..876397f 100644
--- a/if1632/kernel.spec
+++ b/if1632/kernel.spec
@@ -301,6 +301,7 @@
 422 pascal16 GetDiskFreeSpace(ptr ptr ptr ptr ptr) GetDiskFreeSpace16 
 431 pascal16 KERNEL_431(str word) KERNEL_431
 432 stub FileTimeToLocalFileTime
+434 stub KERNEL_434
 435 stub KERNEL_435
 439 stub KERNEL_439
 440 stub KERNEL_440
@@ -355,6 +356,6 @@
 621 stub KERNEL_621
 627 stub IsBadFlatReadWritePtr
 630 stub KERNEL_630
-631 pascal FUNC004(word word long) FUNC004	#C16ThkSl01?
+631 pascal FUNC004(word word word) FUNC004	#C16ThkSl01?
 651 stub KERNEL_651				#ThunkConnect16?
 700 pascal KERNEL_700() stub_KERNEL_700
diff --git a/if1632/ole2.spec b/if1632/ole2.spec
index 5289929..bc54fdc 100644
--- a/if1632/ole2.spec
+++ b/if1632/ole2.spec
@@ -28,14 +28,14 @@
 25 stub OLELOADFROMSTREAM
 26 stub CREATEBINDCTX
 27 stub CREATEITEMMONIKER
-28 stub CREATEFILEMONIKER
+28 pascal CreateFileMoniker(str ptr) CreateFileMoniker16
 29 stub CREATEGENERICCOMPOSITE
-30 stub GETRUNNINGOBJECTTABLE
+30 pascal GetRunningObjectTable(long ptr) GetRunningObjectTable16
 31 stub OLEGETMALLOC
 32 stub RELEASESTGMEDIUM
 33 stub READSTRINGSTREAM
 34 stub WRITESTRINGSTREAM
-35 stub REGISTERDRAGDROP
+35 pascal RegisterDragDrop(word segptr) RegisterDragDrop16
 36 stub REVOKEDRAGDROP
 37 stub DODRAGDROP
 38 stub CREATEOLEADVISEHOLDER
diff --git a/if1632/ole2disp.spec b/if1632/ole2disp.spec
index 7985aa2..3c36c9e 100644
--- a/if1632/ole2disp.spec
+++ b/if1632/ole2disp.spec
@@ -2,12 +2,12 @@
 type	win16
 
 1 stub DLLGETCLASSOBJECT
-2 pascal SysAllocString(ptr)	SysAllocString
-3 pascal SysReallocString(ptr ptr)	SysReAllocString
-4 pascal SysAllocStringLen(ptr word)	SysAllocStringLen
-5 pascal SysReAllocStringLen(ptr ptr word) SysReAllocStringLen
-6 pascal SysFreeString(long)	SysFreeString
-7 pascal SysStringLen(long)	SysStringLen
+2 pascal SysAllocString(str)		SysAllocString
+3 pascal SysReallocString(ptr str)	SysReAllocString
+4 pascal SysAllocStringLen(str word)	SysAllocStringLen
+5 pascal SysReAllocStringLen(ptr str word) SysReAllocStringLen
+6 pascal SysFreeString(segstr)		SysFreeString
+7 pascal SysStringLen(segstr)		SysStringLen
 8 stub VARIANTINIT
 9 stub VARIANTCLEAR
 10 stub VARIANTCOPY
diff --git a/if1632/ole2nls.spec b/if1632/ole2nls.spec
index ca0febc..3b1a846 100644
--- a/if1632/ole2nls.spec
+++ b/if1632/ole2nls.spec
@@ -7,8 +7,8 @@
 4 pascal GetSystemDefaultLangID()  GetSystemDefaultLangID
 5 pascal GetLocaleInfoA(long long ptr word) GetLocaleInfo16
 6 stub LCMAPSTRINGA
-7 pascal16 GetStringTypeA(long long ptr word ptr) GetStringType16
-8 pascal16 CompareStringA(long long ptr word ptr word) CompareString16
+7 pascal16 GetStringTypeA(long long str word ptr) GetStringType16
+8 pascal16 CompareStringA(long long str word str word) CompareString16
 #9 WEP
 10 stub LIBMAIN
 11 stub NOTIFYWINDOWPROC
diff --git a/if1632/olecli.spec b/if1632/olecli.spec
index 65c77a4..656274f 100644
--- a/if1632/olecli.spec
+++ b/if1632/olecli.spec
@@ -56,7 +56,7 @@
 57 stub OLEEXECUTE
 58 stub OLECREATEINVISIBLE
 59 stub OLEQUERYCLIENTVERSION
-60 pascal16 OleIsDcMeta(word) OleIsDcMeta
+60 pascal16 OleIsDcMeta(word) OleIsDcMeta16
 100 stub DOCWNDPROC
 101 stub SRVRWNDPROC
 102 stub MFCALLBACKFUNC
diff --git a/if1632/relay.c b/if1632/relay.c
index 3cc5b0d..0975e08 100644
--- a/if1632/relay.c
+++ b/if1632/relay.c
@@ -17,7 +17,7 @@
 
 #if 0
 /* Make make_debug think these were really used */
-dprintf_info(relay, "test - dummy");
+TRACE(relay, "test - dummy");
 #endif
 
 
@@ -81,7 +81,7 @@
     char *args16;
     int i;
 
-    if (!debugging_info(relay)) return;
+    if (!TRACE_ON(relay)) return;
 
     frame = CURRENT_STACK16;
     printf( "Call %s(", BUILTIN_GetEntryPoint16( frame->entry_cs,
@@ -199,7 +199,7 @@
     STACK16FRAME *frame;
     WORD ordinal;
 
-    if (!debugging_info(relay)) return;
+    if (!TRACE_ON(relay)) return;
     frame = CURRENT_STACK16;
     printf( "Ret  %s() ", BUILTIN_GetEntryPoint16( frame->entry_cs,
                                                    frame->entry_ip,
@@ -257,7 +257,7 @@
 {
     THDB *thdb;
 
-    if (!debugging_info(relay)) return;
+    if (!TRACE_ON(relay)) return;
     thdb = THREAD_Current();
 
     if (nb_args == -1)  /* Register function */
@@ -383,7 +383,7 @@
     if (lpbuf[8] != SS_reg(context))
         fprintf( stderr, "Switching stack segment with Throw() not supported; expect crash now\n" );
 
-    if (debugging_info(relay))  /* Make sure we have a valid entry point address */
+    if (TRACE_ON(relay))  /* Make sure we have a valid entry point address */
     {
         static FARPROC16 entryPoint = NULL;
 
@@ -468,7 +468,7 @@
         if (!Ex) STACK16_POP( THREAD_Current(),
                               (3 + nrofargs) * sizeof(DWORD) );
 
-	dprintf_info(relay,"%s - returns %08lx\n",dbg_str(relay),ret);
+	TRACE(relay,"%s - returns %08lx\n",dbg_str(relay),ret);
 	HeapFree( GetProcessHeap(), 0, args );
 	return ret;
 }
diff --git a/if1632/signal.c b/if1632/signal.c
index d1df7c5..06a36d3 100644
--- a/if1632/signal.c
+++ b/if1632/signal.c
@@ -44,6 +44,7 @@
  */
 static HANDLER_DEF(SIGNAL_break)
 {
+    HANDLER_INIT();
     if (Options.debug)
         wine_debug( signal, HANDLER_CONTEXT );  /* Enter our debugger */
     else exit(0);
@@ -57,6 +58,7 @@
  */
 static HANDLER_DEF(SIGNAL_trap)
 {
+    HANDLER_INIT();
     wine_debug( signal, HANDLER_CONTEXT );  /* Enter our debugger */
 }
 
@@ -70,6 +72,7 @@
 {
     WORD cs;
     GET_CS(cs);
+    HANDLER_INIT();
     if (CS_sig(HANDLER_CONTEXT) == cs)
     {
         fprintf( stderr, "Segmentation fault in 32-bit code (0x%08lx).\n",
diff --git a/if1632/stress.spec b/if1632/stress.spec
index dec65fc..eefa433 100644
--- a/if1632/stress.spec
+++ b/if1632/stress.spec
@@ -14,4 +14,6 @@
 13  pascal freeallusermem()		FreeAllUserMem
 14  pascal allocgdimem(word)		AllocGDIMem
 15  pascal freeallgdimem()		FreeAllGDIMem
-
+16  stub   GETFREEHEAP32SPACE
+17  stub   ALLOCHEAP32MEM
+18  stub   FREEALLHEAP32MEM
diff --git a/if1632/thunk.c b/if1632/thunk.c
index 05eaef7..57ad7ce 100644
--- a/if1632/thunk.c
+++ b/if1632/thunk.c
@@ -226,7 +226,7 @@
             return;
         }
     }
-    dprintf_err(thunk, "THUNK_Free: invalid thunk addr %p\n", thunk );
+    ERR(thunk, "invalid thunk addr %p\n", thunk );
 }
 
 
@@ -625,7 +625,7 @@
     LPDWORD     args = (LPDWORD)xargs;
     DWORD       ret,i;
 
-    dprintf_info(relay,"WOWCallback16Ex(%p,0x%08lx,%ld,%p,%p)\n",
+    TRACE(relay,"(%p,0x%08lx,%ld,%p,%p)\n",
     	proc,dwFlags,cbArgs,xargs,pdwret
     );
     if (dwFlags == WCB16_CDECL) {
diff --git a/if1632/toolhelp.spec b/if1632/toolhelp.spec
index a06f375..8f56c8b 100644
--- a/if1632/toolhelp.spec
+++ b/if1632/toolhelp.spec
@@ -35,3 +35,6 @@
 81 stub TASKSETCSIP
 82 stub TASKGETCSIP
 83 stub TASKSWITCH
+84 stub LOCAL32INFO
+85 stub LOCAL32FIRST
+86 stub LOCAL32NEXT
diff --git a/if1632/typelib.spec b/if1632/typelib.spec
new file mode 100644
index 0000000..b7876e8
--- /dev/null
+++ b/if1632/typelib.spec
@@ -0,0 +1,15 @@
+name typelib
+type win16
+
+2  stub CREATETYPELIB                
+3  stub LOADTYPELIB                  
+4  stub LHASHVALOFNAMESYS            
+5  stub _IID_ICREATETYPEINFO         
+6  stub _IID_ICREATETYPELIB          
+7  stub _IID_ITYPECOMP               
+8  stub _IID_ITYPEINFO               
+9  stub _IID_ITYPELIB                
+10 stub REGISTERTYPELIB              
+11 stub LOADREGTYPELIB               
+14 pascal QueryPathOfRegTypeLib(ptr word word word ptr) QueryPathOfRegTypeLib
+15 stub OABUILDVERSION               
diff --git a/if1632/user.spec b/if1632/user.spec
index 33d8c3c..41bb045 100644
--- a/if1632/user.spec
+++ b/if1632/user.spec
@@ -218,7 +218,7 @@
 213 pascal16 BuildCommDCB(ptr ptr) BuildCommDCB16
 214 pascal   EscapeCommFunction(word word) EscapeCommFunction16
 215 pascal16 FlushComm(word word) FlushComm
-216 stub USERSEEUSERDO
+216 pascal   UserSeeUserDo(word word word word) UserSeeUserDo
 217 pascal16 LookupMenuHandle(word s_word) LookupMenuHandle
 218 pascal16 DialogBoxIndirect(word word word segptr) DialogBoxIndirect16
 219 pascal16 CreateDialogIndirect(word ptr word segptr) CreateDialogIndirect16
diff --git a/include/acconfig.h b/include/acconfig.h
index dacc345..512364b 100644
--- a/include/acconfig.h
+++ b/include/acconfig.h
@@ -20,3 +20,6 @@
 
 /* Define if X libraries are not reentrant (compiled without -D_REENTRANT).  */
 #undef NO_REENTRANT_X11
+
+/* Define if you have machine/soundcard.h instead of sys/soundcard.h.  */
+#undef HAVE_MACHINE_SOUNDCARD_H
diff --git a/include/commctrl.h b/include/commctrl.h
index a8b0ae1..38ea959 100644
--- a/include/commctrl.h
+++ b/include/commctrl.h
@@ -108,4 +108,84 @@
 VOID       WINAPI DrawStatusText32W(HDC32,LPRECT32,LPCWSTR,UINT32);
 #define    DrawStatusText WINELIB_NAME_AW(DrawStatusText)
 
+
+/* ImageList */
+
+#if defined(__WINE__) && defined(__WINE_IMAGELIST_C)
+#else
+struct _IMAGELIST;
+typedef struct _IMAGELIST *HIMAGELIST;
+#endif  /* __WINE__ */
+
+#define CLR_NONE      0xFFFFFFFF
+#define CLR_DEFAULT   0x00000000
+#define CLR_HILIGHT   CLR_DEFAULT
+
+#define ILC_MASK       0x0001
+#define ILC_COLOR      0x0000
+#define ILC_COLORDDB   0x00FE
+#define ILC_COLOR4     0x0004
+#define ILC_COLOR8     0x0008
+#define ILC_COLOR16    0x0010
+#define ILC_COLOR24    0x0018
+#define ILC_COLOR32    0x0020
+#define ILC_PALETTE    0x0800
+
+#define ILD_NORMAL       0x0000
+#define ILD_TRANSPARENT  0x0001
+#define ILD_BLEND25      0x0002
+#define ILD_BLEND50      0x0004
+#define ILD_MASK         0x0010
+#define ILD_IMAGE        0x0020
+#define ILD_ROP          0x0040
+#define ILD_OVERLAYMASK  0x0F00
+
+#define ILD_SELECTED     ILD_BLEND50
+#define ILD_FOCUS        ILD_BLEND25
+#define ILD_BLEND        ILD_BLEND50
+
+#define INDEXTOOVERLAYMASK(i)  ((i)<<8)
+
+typedef struct _IMAGEINFO
+{
+    HBITMAP32 hbmImage;
+    HBITMAP32 hbmMask;
+    INT32     Unused1;
+    INT32     Unused2;
+    RECT32    rcImage;
+} IMAGEINFO;
+
+
+INT32      WINAPI ImageList_Add(HIMAGELIST,HBITMAP32,HBITMAP32);
+INT32      WINAPI ImageList_AddMasked(HIMAGELIST,HBITMAP32,COLORREF);
+
+HIMAGELIST WINAPI ImageList_Create(INT32,INT32,UINT32,INT32,INT32);
+BOOL32     WINAPI ImageList_Destroy(HIMAGELIST);
+
+BOOL32     WINAPI ImageList_Draw(HIMAGELIST,INT32,HDC32,INT32,INT32,UINT32);
+
+COLORREF   WINAPI ImageList_GetBkColor(HIMAGELIST);
+
+BOOL32     WINAPI ImageList_GetIconSize(HIMAGELIST,INT32*,INT32*);
+INT32      WINAPI ImageList_GetImageCount(HIMAGELIST);
+BOOL32     WINAPI ImageList_GetImageInfo(HIMAGELIST,INT32,IMAGEINFO*);
+
+HIMAGELIST WINAPI ImageList_LoadImage32A(HINSTANCE32,LPCSTR,INT32,INT32,
+                                         COLORREF,UINT32,UINT32);
+HIMAGELIST WINAPI ImageList_LoadImage32W(HINSTANCE32,LPCWSTR,INT32,INT32,
+                                         COLORREF,UINT32,UINT32);
+#define    ImageList_LoadImage WINELIB_NAME_AW(ImageList_LoadImage)
+HIMAGELIST WINAPI ImageList_Merge(HIMAGELIST,INT32,HIMAGELIST,INT32,INT32,INT32);
+
+BOOL32     WINAPI ImageList_Replace(HIMAGELIST,INT32,HBITMAP32,HBITMAP32);
+INT32      WINAPI ImageList_ReplaceIcon(HIMAGELIST,INT32,HICON32);
+
+COLORREF   WINAPI ImageList_SetBkColor(HIMAGELIST,COLORREF);
+
+BOOL32     WINAPI ImageList_SetOverlayImage(HIMAGELIST,INT32,INT32);
+
+#define ImageList_AddIcon(himl,hicon) ImageList_ReplaceIcon(himl,-1,hicon)
+#define ImageList_LoadBitmap(hi,lpbmp,cx,cGrow,crMask) \
+  ImageList_LoadImage(hi,lpbmp,cx,cGrow,crMask,IMAGE_BITMAP,0)
+
 #endif  /* __WINE_COMMCTRL_H */
diff --git a/include/config.h.in b/include/config.h.in
index 5bd94d2..de3ec65 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -33,6 +33,9 @@
 /* Define if X libraries are not reentrant (compiled without -D_REENTRANT).  */
 #undef NO_REENTRANT_X11
 
+/* Define if you have machine/soundcard.h instead of sys/soundcard.h.  */
+#undef HAVE_MACHINE_SOUNDCARD_H
+
 /* Define if you have the clone function.  */
 #undef HAVE_CLONE
 
@@ -45,6 +48,9 @@
 /* Define if you have the tcgetattr function.  */
 #undef HAVE_TCGETATTR
 
+/* Define if you have the timegm function.  */
+#undef HAVE_TIMEGM
+
 /* Define if you have the usleep function.  */
 #undef HAVE_USLEEP
 
diff --git a/include/debug.h b/include/debug.h
index f00ff57..cde1891 100644
--- a/include/debug.h
+++ b/include/debug.h
@@ -1,9 +1,10 @@
 /* Do not modify this file -- it is automatically generated! */
 
-#ifndef __DEBUGTOOLS_H
+#ifndef __WINE_DEBUGTOOLS_H
 #include "debugtools.h"
 #endif
 
+/* Definitions for channels identifiers */
 #define dbch_accel 0
 #define dbch_aspi 1
 #define dbch_atom 2
@@ -22,74 +23,82 @@
 #define dbch_cursor 15
 #define dbch_dc 16
 #define dbch_dde 17
-#define dbch_ddraw 18
-#define dbch_dialog 19
-#define dbch_dll 20
-#define dbch_dosfs 21
-#define dbch_driver 22
-#define dbch_dsound 23
-#define dbch_edit 24
-#define dbch_event 25
-#define dbch_exec 26
-#define dbch_file 27
-#define dbch_fixup 28
-#define dbch_font 29
-#define dbch_gdi 30
-#define dbch_global 31
-#define dbch_graphics 32
-#define dbch_heap 33
-#define dbch_hook 34
-#define dbch_icon 35
-#define dbch_int 36
-#define dbch_key 37
-#define dbch_keyboard 38
-#define dbch_ldt 39
-#define dbch_listbox 40
-#define dbch_local 41
-#define dbch_mci 42
-#define dbch_mcianim 43
-#define dbch_mciwave 44
-#define dbch_mdi 45
-#define dbch_menu 46
-#define dbch_message 47
-#define dbch_metafile 48
-#define dbch_midi 49
-#define dbch_mmaux 50
-#define dbch_mmio 51
-#define dbch_mmsys 52
-#define dbch_mmtime 53
-#define dbch_module 54
-#define dbch_msg 55
-#define dbch_nonclient 56
-#define dbch_ole 57
-#define dbch_palette 58
-#define dbch_profile 59
-#define dbch_progress 60
-#define dbch_prop 61
-#define dbch_reg 62
-#define dbch_region 63
-#define dbch_relay 64
-#define dbch_resource 65
-#define dbch_scroll 66
-#define dbch_selector 67
-#define dbch_sem 68
-#define dbch_sendmsg 69
-#define dbch_shm 70
-#define dbch_stddeb 71
-#define dbch_stress 72
-#define dbch_string 73
-#define dbch_task 74
-#define dbch_text 75
-#define dbch_thunk 76
-#define dbch_timer 77
-#define dbch_toolhelp 78
-#define dbch_tweak 79
-#define dbch_updown 80
-#define dbch_ver 81
-#define dbch_virtual 82
-#define dbch_vxd 83
-#define dbch_win 84
-#define dbch_win16drv 85
-#define dbch_win32 86
-#define dbch_winsock 87
-#define dbch_x11 88
+#define dbch_ddeml 18
+#define dbch_ddraw 19
+#define dbch_dialog 20
+#define dbch_dll 21
+#define dbch_dosfs 22
+#define dbch_driver 23
+#define dbch_dsound 24
+#define dbch_edit 25
+#define dbch_event 26
+#define dbch_exec 27
+#define dbch_file 28
+#define dbch_fixup 29
+#define dbch_font 30
+#define dbch_gdi 31
+#define dbch_global 32
+#define dbch_graphics 33
+#define dbch_heap 34
+#define dbch_hook 35
+#define dbch_icon 36
+#define dbch_int 37
+#define dbch_int21 38
+#define dbch_key 39
+#define dbch_keyboard 40
+#define dbch_ldt 41
+#define dbch_listbox 42
+#define dbch_local 43
+#define dbch_mci 44
+#define dbch_mcianim 45
+#define dbch_mciwave 46
+#define dbch_mdi 47
+#define dbch_menu 48
+#define dbch_message 49
+#define dbch_metafile 50
+#define dbch_midi 51
+#define dbch_mmaux 52
+#define dbch_mmio 53
+#define dbch_mmsys 54
+#define dbch_mmtime 55
+#define dbch_module 56
+#define dbch_msg 57
+#define dbch_nonclient 58
+#define dbch_ole 59
+#define dbch_palette 60
+#define dbch_profile 61
+#define dbch_progress 62
+#define dbch_prop 63
+#define dbch_reg 64
+#define dbch_region 65
+#define dbch_relay 66
+#define dbch_resource 67
+#define dbch_scroll 68
+#define dbch_selector 69
+#define dbch_sem 70
+#define dbch_sendmsg 71
+#define dbch_shm 72
+#define dbch_static 73
+#define dbch_stress 74
+#define dbch_string 75
+#define dbch_task 76
+#define dbch_text 77
+#define dbch_thunk 78
+#define dbch_timer 79
+#define dbch_toolhelp 80
+#define dbch_tweak 81
+#define dbch_uitools 82
+#define dbch_updown 83
+#define dbch_ver 84
+#define dbch_virtual 85
+#define dbch_vxd 86
+#define dbch_win 87
+#define dbch_win16drv 88
+#define dbch_win32 89
+#define dbch_winsock 90
+#define dbch_x11 91
+/* Definitions for classes identifiers */
+#define dbcl_fixme 0
+#define dbcl_err 1
+#define dbcl_warn 2
+#define dbcl_trace 3
diff --git a/include/debugdefs.h b/include/debugdefs.h
index efa6371..93f5096 100644
--- a/include/debugdefs.h
+++ b/include/debugdefs.h
@@ -1,10 +1,10 @@
 /* Do not modify this file -- it is automatically generated! */
 
-#ifndef __DEBUGTOOLS_H
+#ifndef __WINE_DEBUGTOOLS_H
 #include "debugtools.h"
 #endif
 
-#define DEBUG_CHANNEL_COUNT 89
+#define DEBUG_CHANNEL_COUNT 92
 #ifdef DEBUG_RUNTIME
 short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
 {1, 1, 0, 0},
@@ -96,6 +96,9 @@
 {1, 1, 0, 0},
 {1, 1, 0, 0},
 {1, 1, 0, 0},
+{1, 1, 0, 0},
+{1, 1, 0, 0},
+{1, 1, 0, 0},
 };
 const char* debug_ch_name[] = {
 "accel",
@@ -116,6 +119,7 @@
 "cursor",
 "dc",
 "dde",
+"ddeml",
 "ddraw",
 "dialog",
 "dll",
@@ -135,6 +139,7 @@
 "hook",
 "icon",
 "int",
+"int21",
 "key",
 "keyboard",
 "ldt",
@@ -169,7 +174,7 @@
 "sem",
 "sendmsg",
 "shm",
-"stddeb",
+"static",
 "stress",
 "string",
 "task",
@@ -178,6 +183,7 @@
 "timer",
 "toolhelp",
 "tweak",
+"uitools",
 "updown",
 "ver",
 "virtual",
@@ -188,9 +194,12 @@
 "winsock",
 "x11",
 };
-
-const char* debug_cl_name[] =
-{ "fixme", "err", "warn", "info" };
+const char* debug_cl_name[] = {
+"fixme",
+"err",
+"warn",
+"trace",
+};
 
 #endif /*DEBUG_RUNTIME*/
 
diff --git a/include/debugtools.h b/include/debugtools.h
index 393dd25..b133809 100644
--- a/include/debugtools.h
+++ b/include/debugtools.h
@@ -1,6 +1,6 @@
 
-#ifndef __DEBUGTOOLS_H
-#define __DEBUGTOOLS_H
+#ifndef __WINE_DEBUGTOOLS_H
+#define __WINE_DEBUGTOOLS_H
 
 #include <stdio.h>
 
@@ -11,8 +11,6 @@
 #define DEBUG_CLASS_COUNT 4
 
 extern short debug_msg_enabled[][DEBUG_CLASS_COUNT];
-extern const char* debug_ch_name[];
-extern const char* debug_cl_name[];
 
 #define dbg_str(name) debug_str_##name
 #define dbg_buf(name) debug_buf_##name
@@ -29,38 +27,25 @@
 #define dbg_ch_index(ch) (dbch_##ch)
 #define dbg_cl_index(cl) (dbcl_##cl)
 
-#define debugging_(cl, ch) \
+#define DEBUGGING(cl, ch) \
   (dbg_ch_index(ch) >=0 && dbg_cl_index(cl) >= 0 && \
    debug_msg_enabled[dbg_ch_index(ch)][dbg_cl_index(cl)])
 
-#define dprintf(format, args...) \
+#define DPRINTF(format, args...) \
   fprintf(stddeb, format, ## args)
 
-#define dprintf_(cl, ch, format, args...) \
-            if(!debugging_(cl, ch)) ; \
-            else dprintf("%s:%s:%s:%d:%s: "format, \
-                         debug_cl_name[dbg_cl_index(cl)], \
-                         debug_ch_name[dbg_ch_index(ch)], \
-	                 __FILE__, __LINE__, __FUNCTION__ , ## args)
+#define DPRINTF_(cl, ch, format, args...) \
+  if(!DEBUGGING(cl, ch)) ; \
+  else DPRINTF(# cl ":" # ch ":%s " format, __FUNCTION__ , ## args)
 
+#define TRACE(ch, fmt, args...) DPRINTF_(trace, ch, fmt, ## args)
+#define WARN(ch, fmt, args...)  DPRINTF_(warn,  ch, fmt, ## args)
+#define FIXME(ch, fmt, args...) DPRINTF_(fixme, ch, fmt, ## args)
+#define ERR(ch, fmt, args...)   DPRINTF_(err, ch, fmt, ## args)
 
+#define FIXME_ON(ch)  DEBUGGING(fixme, ch)
+#define ERR_ON(ch)    DEBUGGING(err, ch)
+#define WARN_ON(ch)   DEBUGGING(warn, ch)
+#define TRACE_ON(ch)  DEBUGGING(trace, ch)
 
-#define debugging_fixme(ch) debugging_(fixme, ch)
-#define debugging_err(ch) debugging_(err, ch)
-#define debugging_warn(ch) debugging_(warn, ch)
-#define debugging_info(ch) debugging_(info, ch)
-
-#define dprintf_fixme(ch, format, args...) dprintf_(fixme, ch, format, ## args)
-#define dprintf_err(ch, format, args...) dprintf_(err, ch, format, ## args)
-#define dprintf_warn(ch, format, args...) dprintf_(warn, ch, format, ## args)
-#define dprintf_info(ch, format, args...) dprintf_(info, ch, format, ## args)
-
-#define dbcl_fixme 0
-#define dbcl_err   1
-#define dbcl_warn  2
-#define dbcl_info  3
-
-#endif
-
-
-
+#endif  /* __WINE_DEBUGTOOLS_H */
diff --git a/include/imagelist.h b/include/imagelist.h
new file mode 100644
index 0000000..891322b
--- /dev/null
+++ b/include/imagelist.h
@@ -0,0 +1,28 @@
+/*
+ * ImageList definitions
+ *
+ * Copyright 1998 Eric Kohl
+ */
+ 
+#ifndef __WINE_IMAGELIST_H
+#define __WINE_IMAGELIST_H
+ 
+struct _IMAGELIST
+{
+    HANDLE32  hHeap;
+    HBITMAP32 hbmImage;
+    HBITMAP32 hbmMask;
+    COLORREF  clrBk;
+    INT32     cGrow;
+    INT32     cMaxImage;
+    INT32     cCurImage;
+    INT32     cx;
+    INT32     cy;
+    UINT32    flags;
+    INT32     nOvlIdx[4];
+};
+ 
+typedef struct _IMAGELIST *HIMAGELIST;
+ 
+ 
+#endif  /* __WINE_IMAGELIST_H */
diff --git a/include/msdos.h b/include/msdos.h
index 9a9017a..ba86fe6 100644
--- a/include/msdos.h
+++ b/include/msdos.h
@@ -56,6 +56,42 @@
     DWORD  filesize;             /* 1c file size */
 } DOS_DIRENTRY_LAYOUT;
 
+typedef struct
+{
+    WORD  CX_Int21_5e01;	/* contents of CX from INT 21/AX=5E01h */
+    WORD  LRU_count_FCB_cache;	
+    WORD  LRU_count_FCB_open;
+    DWORD OEM_func_handler WINE_PACKED; /* OEM function of INT 21/AH=F8h */
+    WORD  INT21_offset;/* offset in DOS CS of code to return from INT 21 call */
+    WORD  sharing_retry_count;
+    WORD  sharing_retry_delay;
+    DWORD ptr_disk_buf;		/* ptr to current disk buf */
+    WORD  offs_unread_CON;	/* pointer in DOS data segment of unread CON input */
+    WORD  seg_first_MCB;
+    DWORD ptr_first_DPB;
+    DWORD ptr_first_SysFileTable;
+    DWORD ptr_clock_dev_hdr;
+    DWORD ptr_CON_dev_hdr;
+    WORD  max_byte_per_sec;   /* maximum bytes per sector of any block device */
+    DWORD ptr_disk_buf_info WINE_PACKED;
+    DWORD ptr_array_CDS WINE_PACKED; /* current directory structure */
+    DWORD ptr_sys_FCB WINE_PACKED;
+    WORD  nr_protect_FCB;
+    BYTE  nr_block_dev;
+    BYTE  nr_avail_drive_letters;
+    BYTE  NUL_dev_header[18];
+    BYTE  nr_drives_JOINed;
+    WORD  ptr_spec_prg_names WINE_PACKED;
+    DWORD ptr_SETVER_prg_list WINE_PACKED;
+    WORD DOS_HIGH_A20_func_offs WINE_PACKED;
+    WORD PSP_last_exec WINE_PACKED; /* if DOS in HMA: PSP of program executed last; if DOS low: 0000h */
+    WORD BUFFERS_val WINE_PACKED;
+    WORD BUFFERS_nr_lookahead WINE_PACKED;
+    BYTE boot_drive WINE_PACKED;
+    BYTE flag_DWORD_moves WINE_PACKED; /* 01h for 386+, 00h otherwise */
+    WORD size_extended_mem WINE_PACKED; /* size of extended mem in KB */
+} DOS_LISTOFLISTS;
+
 #define MAX_DOS_DRIVES	26
 
 extern struct DosDeviceStruct COM[MAX_PORTS];
diff --git a/include/neexe.h b/include/neexe.h
index 5378fd9..c5c263f 100644
--- a/include/neexe.h
+++ b/include/neexe.h
@@ -13,25 +13,27 @@
  */
 typedef struct
 {
-	WORD	e_magic;	/* MZ Header signature */
-	WORD	e_cblp;		/* Bytes on last page of file */
-	WORD	e_cp;		/* Pages in file */
-	WORD	e_crlc;		/* Relocations */
-	WORD	e_cparhdr;	/* Size of header in paragraphs */
-	WORD	e_minalloc;	/* Minimum extra paragraphs needed */
-	WORD	e_maxalloc;	/* Maximum extra paragraphs needed */
-	WORD	e_ss;		/* Initial (relative) SS value */
-	WORD	e_sp;		/* Initial SP value */
-	WORD	e_csum;		/* Checksum */
-	WORD	e_ip;		/* Initial IP value */
-	WORD	e_cs;		/* Initial (relative) CS value */
-	WORD	e_lfarlc;	/* File address of relocation table */
-	WORD	e_ovno;		/* Overlay number */
-	WORD	e_res[4];	/* Reserved words */
-	WORD	e_oemid;	/* OEM identifier (for e_oeminfo) */
-	WORD	e_oeminfo;	/* OEM information; e_oemid specific */
-	WORD	e_res2[10];	/* Reserved words */
-	WORD	e_lfanew;	/* Offset to extended header */
+    WORD  e_magic;      /* 00: MZ Header signature */
+    WORD  e_cblp;       /* 02: Bytes on last page of file */
+    WORD  e_cp;         /* 04: Pages in file */
+    WORD  e_crlc;       /* 06: Relocations */
+    WORD  e_cparhdr;    /* 08: Size of header in paragraphs */
+    WORD  e_minalloc;   /* 0a: Minimum extra paragraphs needed */
+    WORD  e_maxalloc;   /* 0c: Maximum extra paragraphs needed */
+    WORD  e_ss;         /* 0e: Initial (relative) SS value */
+    WORD  e_sp;         /* 10: Initial SP value */
+    WORD  e_csum;       /* 12: Checksum */
+    WORD  e_ip;         /* 14: Initial IP value */
+    WORD  e_cs;         /* 16: Initial (relative) CS value */
+    WORD  e_lfarlc;     /* 18: File address of relocation table */
+    WORD  e_ovno;       /* 1a: Overlay number */
+    WORD  e_res[4];     /* 1c: Reserved words */
+    WORD  e_oemid;      /* 24: OEM identifier (for e_oeminfo) */
+    WORD  e_oeminfo;    /* 26: OEM information; e_oemid specific */
+    WORD  e_res2[10];   /* 28: Reserved words */
+    WORD  e_lfanew;     /* 3c: Offset to extended header */
+    WORD  e_xxx;        /* 3e: Wine internal pad (some programs expect
+                         *     this to be 0) */
 } IMAGE_DOS_HEADER,*LPIMAGE_DOS_HEADER;
 
 #define	IMAGE_DOS_SIGNATURE	0x5A4D		/* MZ */
diff --git a/include/ole.h b/include/ole.h
index cf05190..fd671be 100644
--- a/include/ole.h
+++ b/include/ole.h
@@ -119,7 +119,7 @@
 	oleupdate_always,
 	oleupdate_onsave,
 	oleupdate_oncall,
-	oleupdate_onclose,
+	oleupdate_onclose
 } OLEOPT_UPDATE;
 
 typedef	LONG	LHSERVER;
diff --git a/include/ole2.h b/include/ole2.h
index 391843f..f669929 100644
--- a/include/ole2.h
+++ b/include/ole2.h
@@ -7,7 +7,10 @@
 
 typedef LONG HRESULT;
 
+/* to be implemented */
 typedef LPVOID LPMESSAGEFILTER;
+typedef LPVOID LPDROPTARGET;
+typedef LPVOID LPMONIKER;
 
 #define S_OK	0
 #define S_FALSE	1
diff --git a/include/shlobj.h b/include/shlobj.h
index f3cff0a..9d277c1 100644
--- a/include/shlobj.h
+++ b/include/shlobj.h
@@ -96,7 +96,7 @@
 {
     SHGDN_NORMAL            = 0,        /* default (display purpose) */
     SHGDN_INFOLDER          = 1,        /* displayed under a folder (relative)*/
-    SHGDN_FORPARSING        = 0x8000,   /* for ParseDisplayName or path */
+    SHGDN_FORPARSING        = 0x8000    /* for ParseDisplayName or path */
 } SHGNO;
 
 /* IShellFolder::EnumObjects */
@@ -104,7 +104,7 @@
 {
     SHCONTF_FOLDERS         = 32,       /* for shell browser */
     SHCONTF_NONFOLDERS      = 64,       /* for default view */
-    SHCONTF_INCLUDEHIDDEN   = 128,      /* for hidden/system objects */
+    SHCONTF_INCLUDEHIDDEN   = 128       /* for hidden/system objects */
 } SHCONTF;
 
 /* from oleidl.h */
@@ -183,13 +183,13 @@
 typedef enum {
     SLR_NO_UI           = 0x0001,
     SLR_ANY_MATCH       = 0x0002,
-    SLR_UPDATE          = 0x0004,
+    SLR_UPDATE          = 0x0004
 } SLR_FLAGS;
 
 /* IShellLink::GetPath fFlags */
 typedef enum {
     SLGP_SHORTPATH      = 0x0001,
-    SLGP_UNCPRIORITY    = 0x0002,
+    SLGP_UNCPRIORITY    = 0x0002
 } SLGP_FLAGS;
 
 
diff --git a/include/sig_context.h b/include/sig_context.h
index 0e7b01e..3db18ea 100644
--- a/include/sig_context.h
+++ b/include/sig_context.h
@@ -214,6 +214,17 @@
                             
 #define FL_sig(context)      (*(WORD*)&EFL_sig(context))
 
+#ifdef FS_sig
+#define HANDLER_INIT() SET_FS(FS_sig(HANDLER_CONTEXT))
+#else FS_sig
+#define HANDLER_INIT() /* nothing */
+#endif
+
+#else /* __i386__ */
+
+#define HANDLER_DEF(name) void name (int signal)
+#define HANDLER_INIT() /* nothing */
+
 #endif /* __i386__ */
 
 #endif /* __WINE_SIG_CONTEXT_H */
diff --git a/include/user.h b/include/user.h
index b235b76..d1f891c 100644
--- a/include/user.h
+++ b/include/user.h
@@ -23,6 +23,12 @@
 #define USER_HEAP_SEG_ADDR(handle)  \
          ((handle) ? PTR_SEG_OFF_TO_SEGPTR(USER_HeapSel, (handle)) : (SEGPTR)0)
 
+#define USUD_LOCALALLOC        0x0001
+#define USUD_LOCALFREE         0x0002
+#define USUD_LOCALCOMPACT      0x0003
+#define USUD_LOCALHEAP         0x0004
+#define USUD_FIRSTCLASS        0x0005
+
 void USER_SignalProc(HANDLE16, UINT16, UINT16, HINSTANCE16, HQUEUE16);
 void USER_ExitWindows(void);
 HGLOBAL16 USER_CallDefaultRsrcHandler( HGLOBAL16 hMemObj, HMODULE16 hModule,
diff --git a/include/version.h b/include/version.h
index c224a7a..8f5202a 100644
--- a/include/version.h
+++ b/include/version.h
@@ -1 +1 @@
-#define WINE_RELEASE_INFO "Wine release 980301"
+#define WINE_RELEASE_INFO "Wine release 980315"
diff --git a/include/windows.h b/include/windows.h
index b4393de..5944f83 100644
--- a/include/windows.h
+++ b/include/windows.h
@@ -2101,8 +2101,8 @@
 /* 64 bit number of 100 nanoseconds intervals since January 1, 1601 */
 typedef struct
 {
-  INT32  dwLowDateTime;
-  INT32  dwHighDateTime;
+  DWORD  dwLowDateTime;
+  DWORD  dwHighDateTime;
 } FILETIME, *LPFILETIME;
 
 /* Find* structures */
@@ -4429,6 +4429,147 @@
                                        INT32,LPARAM);
 DECL_WINELIB_TYPE(MFENUMPROC);
 
+/* enhanced metafile structures and functions */
+
+/* note that ENHMETAHEADER is just a particular kind of ENHMETARECORD,
+   ie. the header is just the first record in the metafile */
+typedef struct {
+    DWORD iType; 
+    DWORD nSize; 
+    RECT32 rclBounds; 
+    RECT32 rclFrame; 
+    DWORD dSignature; 
+    DWORD nVersion; 
+    DWORD nBytes; 
+    DWORD nRecords; 
+    WORD  nHandles; 
+    WORD  sReserved; 
+    DWORD nDescription; 
+    DWORD offDescription; 
+    DWORD nPalEntries; 
+    SIZE32 szlDevice; 
+    SIZE32 szlMillimeters;
+    DWORD cbPixelFormat;
+    DWORD offPixelFormat;
+    DWORD bOpenGL;
+} ENHMETAHEADER, *LPENHMETAHEADER; 
+
+typedef struct {
+    DWORD iType; 
+    DWORD nSize; 
+    DWORD dParm[1]; 
+} ENHMETARECORD, *LPENHMETARECORD; 
+
+typedef INT32 (CALLBACK *ENHMFENUMPROC32)(HDC32, LPHANDLETABLE32, 
+					  LPENHMETARECORD, INT32, LPVOID);
+
+#define EMR_HEADER	1
+#define EMR_POLYBEZIER	2
+#define EMR_POLYGON	3
+#define EMR_POLYLINE	4
+#define EMR_POLYBEZIERTO	5
+#define EMR_POLYLINETO	6
+#define EMR_POLYPOLYLINE	7
+#define EMR_POLYPOLYGON	8
+#define EMR_SETWINDOWEXTEX	9
+#define EMR_SETWINDOWORGEX	10
+#define EMR_SETVIEWPORTEXTEX	11
+#define EMR_SETVIEWPORTORGEX	12
+#define EMR_SETBRUSHORGEX	13
+#define EMR_EOF	14
+#define EMR_SETPIXELV	15
+#define EMR_SETMAPPERFLAGS	16
+#define EMR_SETMAPMODE	17
+#define EMR_SETBKMODE	18
+#define EMR_SETPOLYFILLMODE	19
+#define EMR_SETROP2	20
+#define EMR_SETSTRETCHBLTMODE	21
+#define EMR_SETTEXTALIGN	22
+#define EMR_SETCOLORADJUSTMENT	23
+#define EMR_SETTEXTCOLOR	24
+#define EMR_SETBKCOLOR	25
+#define EMR_OFFSETCLIPRGN	26
+#define EMR_MOVETOEX	27
+#define EMR_SETMETARGN	28
+#define EMR_EXCLUDECLIPRECT	29
+#define EMR_INTERSECTCLIPRECT	30
+#define EMR_SCALEVIEWPORTEXTEX	31
+#define EMR_SCALEWINDOWEXTEX	32
+#define EMR_SAVEDC	33
+#define EMR_RESTOREDC	34
+#define EMR_SETWORLDTRANSFORM	35
+#define EMR_MODIFYWORLDTRANSFORM	36
+#define EMR_SELECTOBJECT	37
+#define EMR_CREATEPEN	38
+#define EMR_CREATEBRUSHINDIRECT	39
+#define EMR_DELETEOBJECT	40
+#define EMR_ANGLEARC	41
+#define EMR_ELLIPSE	42
+#define EMR_RECTANGLE	43
+#define EMR_ROUNDRECT	44
+#define EMR_ARC	45
+#define EMR_CHORD	46
+#define EMR_PIE	47
+#define EMR_SELECTPALETTE	48
+#define EMR_CREATEPALETTE	49
+#define EMR_SETPALETTEENTRIES	50
+#define EMR_RESIZEPALETTE	51
+#define EMR_REALIZEPALETTE	52
+#define EMR_EXTFLOODFILL	53
+#define EMR_LINETO	54
+#define EMR_ARCTO	55
+#define EMR_POLYDRAW	56
+#define EMR_SETARCDIRECTION	57
+#define EMR_SETMITERLIMIT	58
+#define EMR_BEGINPATH	59
+#define EMR_ENDPATH	60
+#define EMR_CLOSEFIGURE	61
+#define EMR_FILLPATH	62
+#define EMR_STROKEANDFILLPATH	63
+#define EMR_STROKEPATH	64
+#define EMR_FLATTENPATH	65
+#define EMR_WIDENPATH	66
+#define EMR_SELECTCLIPPATH	67
+#define EMR_ABORTPATH	68
+#define EMR_GDICOMMENT	70
+#define EMR_FILLRGN	71
+#define EMR_FRAMERGN	72
+#define EMR_INVERTRGN	73
+#define EMR_PAINTRGN	74
+#define EMR_EXTSELECTCLIPRGN	75
+#define EMR_BITBLT	76
+#define EMR_STRETCHBLT	77
+#define EMR_MASKBLT	78
+#define EMR_PLGBLT	79
+#define EMR_SETDIBITSTODEVICE	80
+#define EMR_STRETCHDIBITS	81
+#define EMR_EXTCREATEFONTINDIRECTW	82
+#define EMR_EXTTEXTOUTA	83
+#define EMR_EXTTEXTOUTW	84
+#define EMR_POLYBEZIER16	85
+#define EMR_POLYGON16	86
+#define EMR_POLYLINE16	87
+#define EMR_POLYBEZIERTO16	88
+#define EMR_POLYLINETO16	89
+#define EMR_POLYPOLYLINE16	90
+#define EMR_POLYPOLYGON16	91
+#define EMR_POLYDRAW16	92
+#define EMR_CREATEMONOBRUSH	93
+#define EMR_CREATEDIBPATTERNBRUSHPT	94
+#define EMR_EXTCREATEPEN	95
+#define EMR_POLYTEXTOUTA	96
+#define EMR_POLYTEXTOUTW	97
+#define EMR_SETICMMODE	98
+#define EMR_CREATECOLORSPACE	99
+#define EMR_SETCOLORSPACE	100
+#define EMR_DELETECOLORSPACE	101
+#define EMR_GLSRECORD	102
+#define EMR_GLSBOUNDEDRECORD	103
+#define EMR_PIXELFORMAT 104
+
+#define ENHMETA_SIGNATURE	1179469088
+
+
 #ifndef NOLOGERROR
 
 /* LogParamError and LogError values */
@@ -4935,6 +5076,7 @@
 } PRINTER_DEFAULTS32W, *LPPRINTER_DEFAULTS32W;
 
 DECL_WINELIB_TYPE_AW(PRINTER_DEFAULTS);
+DECL_WINELIB_TYPE_AW(LPPRINTER_DEFAULTS);
 
 typedef struct _SYSTEM_POWER_STATUS
 {
@@ -5817,6 +5959,9 @@
 BOOL32      WINAPI GetTextExtentExPoint32W(HDC32,LPCWSTR,INT32,INT32,
                                            LPINT32,LPINT32,LPSIZE32);
 #define     GetTextExtentExPoint WINELIB_NAME_AW(GetTextExtentExPoint)
+INT32       WINAPI GetTimeFormat32A(LCID,DWORD,LPSYSTEMTIME,LPCSTR,LPSTR,INT32);
+INT32       WINAPI GetTimeFormat32W(LCID,DWORD,LPSYSTEMTIME,LPCWSTR,LPWSTR,INT32);
+#define     GetTimeFormat WINELIB_NAME_AW(GetTimeFormat)
 LCID        WINAPI GetThreadLocale();
 INT32       WINAPI GetThreadPriority(HANDLE32);
 BOOL32      WINAPI GetThreadSelectorEntry(HANDLE32,DWORD,LPLDT_ENTRY);
@@ -5957,8 +6102,8 @@
 BOOL32      WINAPI VirtualLock(LPVOID,DWORD);
 BOOL32      WINAPI VirtualProtect(LPVOID,DWORD,DWORD,LPDWORD);
 BOOL32      WINAPI VirtualProtectEx(HANDLE32,LPVOID,DWORD,DWORD,LPDWORD);
-BOOL32      WINAPI VirtualQuery(LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD);
-BOOL32      WINAPI VirtualQueryEx(HANDLE32,LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD);
+DWORD       WINAPI VirtualQuery(LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD);
+DWORD       WINAPI VirtualQueryEx(HANDLE32,LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD);
 BOOL32      WINAPI VirtualUnlock(LPVOID,DWORD);
 DWORD       WINAPI WaitForMultipleObjects(DWORD,const HANDLE32*,BOOL32,DWORD);
 DWORD       WINAPI WaitForMultipleObjectsEx(DWORD,const HANDLE32*,BOOL32,DWORD,BOOL32);
diff --git a/include/winnls.h b/include/winnls.h
index 11704ab..d09bc96 100644
--- a/include/winnls.h
+++ b/include/winnls.h
@@ -127,8 +127,61 @@
 #define MAKELCID(l, s)    (MAKELONG(l, s))
 #define MAKELANGID(p, s)  ((((WORD)(s))<<10) | (WORD)(p))
 
+/* Language IDs (were in winnt.h,  for some reason) */
+
+
+/* Language IDs */
+
+#define LANG_NEUTRAL                     0x00
+#define LANG_ARABIC                      0x01
+#define LANG_AFRIKAANS                   0x36
+#define LANG_ALBANIAN                    0x1c
+#define LANG_BASQUE                      0x2d
+#define LANG_BULGARIAN                   0x02
+#define LANG_BYELORUSSIAN                0x23
+#define LANG_CATALAN                     0x03
+#define LANG_CHINESE                     0x04
+#define LANG_CROATIAN                    0x1a
+#define LANG_CZECH                       0x05
+#define LANG_DANISH                      0x06
+#define LANG_DUTCH                       0x13
+#define LANG_ENGLISH                     0x09
+#define LANG_ESTONIAN                    0x25
+#define LANG_FAEROESE                    0x38
+#define LANG_FARSI                       0x29
+#define LANG_FINNISH                     0x0b
+#define LANG_FRENCH                      0x0c
+#define LANG_GERMAN                      0x07
+#define LANG_GREEK                       0x08
+#define LANG_HEBREW                      0x0D
+#define LANG_HUNGARIAN                   0x0e
+#define LANG_ICELANDIC                   0x0f
+#define LANG_INDONESIAN                  0x21
+#define LANG_ITALIAN                     0x10
+#define LANG_JAPANESE                    0x11
+#define LANG_KOREAN                      0x12
+#define LANG_LATVIAN                     0x26
+#define LANG_LITHUANIAN                  0x27
+#define LANG_NORWEGIAN                   0x14
+#define LANG_POLISH                      0x15
+#define LANG_PORTUGUESE                  0x16
+#define LANG_ROMANIAN                    0x18
+#define LANG_RUSSIAN                     0x19
+#define LANG_SLOVAK                      0x1b
+#define LANG_SLOVENIAN                   0x24
+#define LANG_SORBIAN                     0x2e
+#define LANG_SPANISH                     0x0a
+#define LANG_SWEDISH                     0x1d
+#define LANG_THAI                        0x1e
+#define LANG_TURKISH                     0x1f
+#define LANG_UKRAINIAN                   0x22
+
+/* "default"ish values */
+
 #define SORT_DEFAULT      0
 #define SUBLANG_DEFAULT   1
+#define SUBLANG_SYS_DEFAULT 1 /* FIXME: I don't know if this is right */
+
 
 #define LANG_SYSTEM_DEFAULT   (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT))
 #define LANG_USER_DEFAULT     (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT))
@@ -146,4 +199,12 @@
 #define LCMAP_HALFWIDTH	0x00400000	/* map double byte to single byte */
 #define LCMAP_FULLWIDTH	0x00800000	/* map single byte to double byte */
 
+/* Date Flags for GetDateFormat. */
+
+#define DATE_SHORTDATE         0x00000001  /* use short date picture */
+#define DATE_LONGDATE          0x00000002  /* use long date picture */
+#define DATE_USE_ALT_CALENDAR  0x00000004  /* use alternate calendar */
+                          /* alt. calendar support is broken anyway */
+
+
 #endif  /* __WINE_WINNLS_H */
diff --git a/include/winnt.h b/include/winnt.h
index 8d5a226..0dca3f7 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -272,51 +272,7 @@
 LPTOP_LEVEL_EXCEPTION_FILTER
 WINAPI SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter );
 
-/* Language IDs */
-
-#define LANG_NEUTRAL                     0x00
-#define LANG_ARABIC                      0x01
-#define LANG_AFRIKAANS                   0x36
-#define LANG_ALBANIAN                    0x1c
-#define LANG_BASQUE                      0x2d
-#define LANG_BULGARIAN                   0x02
-#define LANG_BYELORUSSIAN                0x23
-#define LANG_CATALAN                     0x03
-#define LANG_CHINESE                     0x04
-#define LANG_CROATIAN                    0x1a
-#define LANG_CZECH                       0x05
-#define LANG_DANISH                      0x06
-#define LANG_DUTCH                       0x13
-#define LANG_ENGLISH                     0x09
-#define LANG_ESTONIAN                    0x25
-#define LANG_FAEROESE                    0x38
-#define LANG_FARSI                       0x29
-#define LANG_FINNISH                     0x0b
-#define LANG_FRENCH                      0x0c
-#define LANG_GERMAN                      0x07
-#define LANG_GREEK                       0x08
-#define LANG_HEBREW                      0x0D
-#define LANG_HUNGARIAN                   0x0e
-#define LANG_ICELANDIC                   0x0f
-#define LANG_INDONESIAN                  0x21
-#define LANG_ITALIAN                     0x10
-#define LANG_JAPANESE                    0x11
-#define LANG_KOREAN                      0x12
-#define LANG_LATVIAN                     0x26
-#define LANG_LITHUANIAN                  0x27
-#define LANG_NORWEGIAN                   0x14
-#define LANG_POLISH                      0x15
-#define LANG_PORTUGUESE                  0x16
-#define LANG_ROMANIAN                    0x18
-#define LANG_RUSSIAN                     0x19
-#define LANG_SLOVAK                      0x1b
-#define LANG_SLOVENIAN                   0x24
-#define LANG_SORBIAN                     0x2e
-#define LANG_SPANISH                     0x0a
-#define LANG_SWEDISH                     0x1d
-#define LANG_THAI                        0x1e
-#define LANG_TURKISH                     0x1f
-#define LANG_UKRAINIAN                   0x22
+/* I moved the Language IDs to winnls.h (David Lee Lambert) */
 
 
 /* Access rights */
diff --git a/include/wintypes.h b/include/wintypes.h
index 527fbcb..3dac52d 100644
--- a/include/wintypes.h
+++ b/include/wintypes.h
@@ -155,6 +155,7 @@
 DECLARE_HANDLE(HDROP);
 DECLARE_HANDLE(HDRVR);
 DECLARE_HANDLE(HDWP);
+DECLARE_HANDLE(HENHMETAFILE);
 DECLARE_HANDLE(HFILE);
 DECLARE_HANDLE(HFONT);
 DECLARE_HANDLE(HGDIOBJ);
@@ -262,6 +263,7 @@
 DECL_WINELIB_TYPE(HDROP);
 DECL_WINELIB_TYPE(HDRVR);
 DECL_WINELIB_TYPE(HDWP);
+DECL_WINELIB_TYPE(HENHMETAFILE);
 DECL_WINELIB_TYPE(HFILE);
 DECL_WINELIB_TYPE(HFONT);
 DECL_WINELIB_TYPE(HGDIOBJ);
diff --git a/ipc/dde_atom.c b/ipc/dde_atom.c
index 458565a..504280f 100644
--- a/ipc/dde_atom.c
+++ b/ipc/dde_atom.c
@@ -129,7 +129,7 @@
      return (atom<MIN_STR_ATOM) ? atom : 0;
   }
 
-  dprintf_info(atom,"GlobalAddAtom(\"%s\")\n",str);
+  TRACE(atom,"(\"%s\")\n",str);
 
   DDE_IPC_init();		/* will initialize only if needed */
   
@@ -174,7 +174,7 @@
   AtomData_ptr atom_ptr;
   ATOM retval=(ATOM) 0;
   
-  dprintf_info(atom,"GlobalDeleteAtom(\"%d\")\n",(int)atom);
+  TRACE(atom,"(\"%d\")\n",(int)atom);
   atom_idx=(int)atom - MIN_STR_ATOM;
   
   if (atom_idx < 0 )
@@ -211,7 +211,7 @@
   int atom_ofs;
   char *str;
 
-  dprintf_info(atom,"GlobalFindAtom(%08lx)\n", name );
+  TRACE(atom,"(%08lx)\n", name );
 
   /* First check for integer atom */
 
@@ -223,7 +223,7 @@
      ATOM atom= (ATOM) atoi(&str[1]);
      return (atom<MIN_STR_ATOM) ? atom : 0;
   }
-  dprintf_info(atom,"GlobalFindAtom(\"%s\")\n",str);
+  TRACE(atom,"(\"%s\")\n",str);
 
   DDE_IPC_init();		/* will initialize only if needed */
 
diff --git a/ipc/dde_atom_test.c b/ipc/dde_atom_test.c
index b0d0341..4391569 100644
--- a/ipc/dde_atom_test.c
+++ b/ipc/dde_atom_test.c
@@ -24,9 +24,9 @@
   int i,j,atom_n;
   int atom_len[TOGETHER];
   
-  debugging_info(shm)=1;
-  debugging_info(atom)=0;
-  debugging_info(sem)=0;
+  TRACE_ON(shm)=1;
+  TRACE_ON(atom)=0;
+  TRACE_ON(sem)=0;
   
   for (i=0 ; i<=10000/TOGETHER ; i++) {
      for (atom_n=0 ; atom_n<TOGETHER ; atom_n++) {
diff --git a/ipc/dde_mem.c b/ipc/dde_mem.c
index ac29c70..504b330 100644
--- a/ipc/dde_mem.c
+++ b/ipc/dde_mem.c
@@ -58,18 +58,18 @@
 {
   struct shm_block *block;
   
-  dprintf_info(global,"shm:locate_handle(0x%04x)\n", h);
+  TRACE(global,"shm: (0x%04x)\n", h);
 
 
   if (SampleBit( &free_handles, DDE_MEM_IDX(h)) == 0) {
-     dprintf_info(global, "shm:locate_handle: return NULL\n");
+     TRACE(global, "shm: return NULL\n");
      return NULL;		   /* free!!! */
   }
   
   block= shm_locate_block(DDE_MEM_INFO(h).shmid, map);
   if (block == NULL) {
       /* nothing found */
-      dprintf_info(global, "shm:locate_handle: return NULL\n");
+      TRACE(global, "shm: return NULL\n");
       return NULL;
   }
 
@@ -87,7 +87,7 @@
   if (bit_nr != -1)
      return DDE_MEM_HANDLE(bit_nr);
 
-  dprintf_info(global,"dde_alloc_handle: no free DDE handle found\n");
+  TRACE(global,"dde_alloc_handle: no free DDE handle found\n");
   return 0;
 }
 /**********************************************************************
@@ -102,7 +102,7 @@
     struct local_shm_map *curr;
     HGLOBAL16 handle;
     
-    dprintf_info(global,"DDE_malloc flags %4X, size %ld\n", flags, size);
+    TRACE(global,"DDE_malloc flags %4X, size %ld\n", flags, size);
     DDE_IPC_init();		/* make sure main shm block allocated */ 
 
     shm_write_wait(main_block->proc[curr_proc_idx].sem);
@@ -151,14 +151,13 @@
     handle= dde_alloc_handle();
     
     if (handle) {
-       dprintf_info(global,
-		      "DDE_malloc returning handle=0x%4x, ptr=0x%08lx\n",
+       TRACE(global, "returning handle=0x%4x, ptr=0x%08lx\n",
 		      (int)handle, (long) HINFO2DATAPTR(h_info));
        DDE_MEM_INFO(handle).rel=  PTR2REL(block, h_info);
        DDE_MEM_INFO(handle).shmid= shmid;
     }
     else
-       dprintf_warn(global, "DDE_malloc failed\n");
+       WARN(global, "failed\n");
 
     shm_write_signal(main_block->proc[curr_proc_idx].sem);
     
@@ -172,7 +171,7 @@
   int handle_index= h & 0x7fff;
   struct local_shm_map map;
 
-  dprintf_info(global,"DDE_GlobalFree(0x%04x)\n",h);
+  TRACE(global,"(0x%04x)\n",h);
 
   if (h==0)
      return 0;
@@ -238,18 +237,18 @@
   if (segptr != NULL)
       *segptr=0;
 
-  dprintf_info(global,"DDE_AttachHandle(%04x)\n",handle);
+  TRACE(global,"(%04x)\n",handle);
   h_info=locate_handle(handle, NULL);
 
   if (h_info == NULL) 
       return NULL;
 
   if ( !(h_info->flags & GMEM_DDESHARE) ) {
-      fprintf(stderr,"DDE_AttachHandle: Corrupted memory handle info\n");
+      ERR(global,"Corrupted memory handle info\n");
       return NULL;
   }
   
-  dprintf_info(global,"DDE_AttachHandle: h_info=%06lx\n",(long)h_info);
+  TRACE(global,"h_info=%06lx\n",(long)h_info);
 
   shmdata.handle= handle;
   shmdata.shmid= DDE_MEM_INFO(handle).shmid;
@@ -263,10 +262,10 @@
   if (segptr != NULL) 
       *segptr= (SEGPTR)MAKELONG( 0, shmdata.sel);
 
-  if (debugging_info(dde))
+  if (TRACE_ON(dde))
       debug_last_handle_size= h_info->size;
 
-  dprintf_info(global,"DDE_AttachHandle returns ptr=0x%08lx\n", (long)ptr);
+  TRACE(global,"DDE_AttachHandle returns ptr=0x%08lx\n", (long)ptr);
 
   return (LPSTR)ptr;
 
diff --git a/ipc/dde_proc.c b/ipc/dde_proc.c
index a08b069..5d4ae1d 100644
--- a/ipc/dde_proc.c
+++ b/ipc/dde_proc.c
@@ -123,7 +123,7 @@
 {
   dde_proc proc;
   int proc_idx;
-  dprintf_info(dde,"dde_proc_add(..)\n");
+  TRACE(dde,"(..)\n");
   shm_write_wait(main_block->sem);
 
   /* find free proc_idx and allocate it */
@@ -164,7 +164,7 @@
        size= msgrcv( main_block->proc[curr_proc_idx].msg , &ack_buff.dat,
 		     1, DDE_ACK, IPC_NOWAIT);
        if (size>=0) {
-	  dprintf_info(msg,"get_ack: received DDE_ACK message\n");
+	  TRACE(msg,"get_ack: received DDE_ACK message\n");
 	  return TRUE;
        }
        if (DDE_GetRemoteMessage()) {
@@ -197,7 +197,7 @@
      return FALSE;
   }
 
-  if (debugging_info(dde) || debugging_warn_dde) {
+  if (TRACE_ON(dde) || WARN_ON_dde) {
      MSG16 *msg=(MSG16*) &msgbuf->mtext;
      char *title;
      if (msgbuf->mtype==DDE_SEND)
@@ -209,14 +209,12 @@
      if (title)
 	 print_dde_message(title, msg);
      else
-       dprintf_warn(dde, "Unknown message type=0x%lx\n", msgbuf->mtype);
+       WARN(dde, "Unknown message type=0x%lx\n", msgbuf->mtype);
   }
-  dprintf_info(msg,
-	      "DDE_DoOneMessage: to proc_idx=%d (pid=%d), queue=%u\n",
-	      proc_idx, proc->pid, (unsigned)proc->msg);
+  TRACE(msg, "to proc_idx=%d (pid=%d), queue=%u\n",
+	       proc_idx, proc->pid, (unsigned)proc->msg);
   if ( proc->msg != -1) {
-     dprintf_info(msg, "DDE_DoOneMessage: doing...(type=%s)\n",
-		 msg_type[msgbuf->mtype]);
+     TRACE(msg, "doing...(type=%s)\n", msg_type[msgbuf->mtype]);
      size=msgsnd (proc->msg, msgbuf, size, 0);
 
      if (size<0) {
@@ -225,9 +223,8 @@
      }
      kill(proc->pid,SIGUSR2);	   /* tell the process there is a message */
 
-     dprintf_info(msg,"DDE_DoOneMessage: "
-		 "Trying to get acknowledgment from msg queue=%d\n",
-		 proc->msg);
+     TRACE(msg, "Trying to get acknowledgment from msg queue=%d\n",
+		  proc->msg);
      Yield16();			/* force task switch, and */
 				/* acknowledgment sending */
      if (get_ack()) {
@@ -239,8 +236,7 @@
      }
   }
   else {
-     dprintf_warn(msg, "DDE_DoOneMessage: message not sent, "
-		 "target has no message queue\n");
+     WARN(msg, "message not sent, target has no message queue\n");
      return FALSE;
   }
 }
@@ -312,13 +308,12 @@
   if ( ! DDE_IsRemoteWindow(msg->hwnd) && msg->hwnd!= (HWND16)-1)
      return FALSE;
 
-  dprintf_info(msg, "%s: DDE_DoMessage(hwnd=0x%x,msg=0x%x,..)\n",
-	      msg_type[type], (int)msg->hwnd,(int)msg->message);
+  TRACE(msg, "(hwnd=0x%x,msg=0x%x,..) - %s\n",
+	       (int)msg->hwnd,(int)msg->message,msg_type[type]);
+  
 
-
-  dprintf_info(msg,
-	      "DDE_DoMessage(hwnd=0x%x,msg=0x%x,..) // HWND_BROADCAST !\n",
-	      (int)msg->hwnd,(int)msg->message);
+  TRACE(msg, "(hwnd=0x%x,msg=0x%x,..) -- HWND_BROADCAST !\n",
+	       (int)msg->hwnd,(int)msg->message);
   remote_message=(void*)&msg_dat.dat.mtext;
   
   memcpy(remote_message, msg, sizeof(*msg));
@@ -361,10 +356,8 @@
 
    proc=DDE_WIN2PROC(wnd);
    msg=main_block->proc[proc].msg;
-   dprintf_info(msg,"DDE_GetRemoteMessage: sending ACK "
-	       "to wnd=%4x, proc=%d,msg=%d, pid=%d\n",wnd,proc,msg,
-	       main_block->proc[proc].pid
-     );
+   TRACE(msg,"sending ACK to wnd=%4x, proc=%d,msg=%d, pid=%d\n",
+		wnd,proc,msg,main_block->proc[proc].pid);
 
    msg_ack.mtext[0]=val;
    msgsnd (msg, &msg_ack, 1, 0);
@@ -390,7 +383,7 @@
 
   if (nesting>10) {
      fflush(stdout);
-     fprintf(stderr,"DDE_GetRemoteMessage: suspecting infinite recursion, exiting");
+     ERR(msg, "suspecting infinite recursion, exiting");
      return 0;
   }
 
@@ -402,19 +395,17 @@
 
   if (size==DDE_MSG_SIZE) {	   /* is this a correct message (if any) ?*/
      was_sent=TRUE;
-     dprintf_info(msg,
-		 "DDE:receive sent message. msg=%04x wPar=%04x"
-		 " lPar=%08lx\n",
-		 remote_message->message, remote_message->wParam,
-		 remote_message->lParam);
+     TRACE(msg, "DDE:receive sent message. msg=%04x wPar=%04x"
+		  " lPar=%08lx\n",
+		  remote_message->message, remote_message->wParam,
+		  remote_message->lParam);
   } else {
      size= msgrcv( main_block->proc[curr_proc_idx].msg , &msg_dat.dat,
 		   DDE_MSG_SIZE, DDE_POST, IPC_NOWAIT);
 
      if (size==DDE_MSG_SIZE) {	   /* is this a correct message (if any) ?*/
 	was_sent=FALSE;
-	dprintf_info(msg,
-		    "DDE:receive posted message. "
+	TRACE(msg, "DDE:receive posted message. "
 		    "msg=%04x wPar=%04x lPar=%08lx\n",
 		    remote_message->message, remote_message->wParam,
 		    remote_message->lParam);
@@ -429,7 +420,7 @@
 
   nesting++;
 
-  if (debugging_info(dde)) {
+  if (TRACE_ON(dde)) {
      char *title;
      if (was_sent)
 	title="receive sent dde:";
@@ -442,10 +433,8 @@
     HWND16 dde_window= DDE_WIN_INFO(remote_message->hwnd).wnd;
      /* we should know exactly where to send the message (locally)*/
      if (was_sent) {
-	dprintf_info(dde,
-		    "SendMessage(wnd=0x%04x, msg=0x%04x, wPar=0x%04x,"
-		    "lPar=0x%08x\n",
-		    dde_window, remote_message->message,
+	TRACE(dde, "SendMessage(wnd=0x%04x, msg=0x%04x, wPar=0x%04x,"
+		    "lPar=0x%08x\n", dde_window, remote_message->message,
 		    remote_message->wParam, (int)remote_message->lParam);
 
 	/* execute the recieved message */
@@ -524,7 +513,7 @@
      in_test--;
      return;
   }
-  dprintf_info(msg,"DDE_TestDDE(0x%04x)\n", hwnd);
+  TRACE(msg,"(0x%04x)\n", hwnd);
   if (hwnd==0)
       hwnd=-1;
   /* just send a message to see how things are going */
@@ -631,7 +620,7 @@
 	dsprintf(dde," atom=0x%04x",hWord);
 	break;
     }
-    dprintf_info(dde,"%s\n", dbg_str(dde));
+    TRACE(dde,"%s\n", dbg_str(dde));
 }
 
 void dde_proc_done(dde_proc proc)
diff --git a/ipc/shm_block.c b/ipc/shm_block.c
index 5f5570f..6feabd5 100644
--- a/ipc/shm_block.c
+++ b/ipc/shm_block.c
@@ -37,7 +37,7 @@
  */
 void shm_setup_block(struct shm_block *block, int first, int size)
 {
-  dprintf_info(shm,"Setting up shm block at 0x%08x\n",(int )block);
+  TRACE(shm,"Setting up shm block at 0x%08x\n",(int )block);
   /* setup block internal data structure */
   if (first <= 0) {
      first=sizeof(*block);
@@ -53,8 +53,7 @@
   /* block->size is initialized in shm_FragmentInit */
   shm_FragmentInit(block, first, size);  /* first item in the free list */
   
-  dprintf_info(shm,
-	      "block was set up at 0x%08x, size=0x%04xKB, 1st usable=%02x\n",
+  TRACE(shm, "block was set up at 0x%08x, size=0x%04xKB, 1st usable=%02x\n",
 	      (int )block,size/1024,first);
 }
 
diff --git a/ipc/shm_main_blk.c b/ipc/shm_main_blk.c
index 7402475..7c6e90e 100644
--- a/ipc/shm_main_blk.c
+++ b/ipc/shm_main_blk.c
@@ -79,7 +79,7 @@
 /* setup a new main shm block (only construct a shm block object). */
 static void shm_setup_main_block()
 {
-  dprintf_info(shm,"creating data structure\n");
+  TRACE(shm,"creating data structure\n");
   main_block->build_lock=1;
   strcpy(main_block->magic, shm_header);
 
@@ -133,29 +133,29 @@
 
   /* Make sure we don't work on somebody else's block */
   if (shm_info.shm_perm.cuid != getuid()) { /* creator is not me */
-     dprintf_warn(shm, "Creator is not me!\n");
+     WARN(shm, "Creator is not me!\n");
      return 0;
   }
 
-  dprintf_info(shm,"shared memory exist, attaching anywhere\n");
+  TRACE(shm,"shared memory exist, attaching anywhere\n");
   main_block=(struct shm_main_block *)shmat(shm_id, 0, 0);
   if ( (int)main_block==-1) {
-     dprintf_warn(shm, "Attach failed\n");
+     WARN(shm, "Attach failed\n");
      return 0;
   }
 
   if (strcmp(main_block->magic, shm_header) != 0) {
-     dprintf_info(shm,"Detaching, wrong magic\n");
+     TRACE(shm,"Detaching, wrong magic\n");
      shmdt((void *)main_block);
      return 0;
   }
 
-  if (debugging_info(shm))
+  if (TRACE_ON(shm))
      print_shm_info(shm_id);
 
   /* Is it an old unused block ? */
   if (shm_info.shm_nattch == 0) {
-     dprintf_info(shm,"No attaches, deleting old data\n");
+     TRACE(shm,"No attaches, deleting old data\n");
      shm_delete_all(shm_id);
      return 0;
   }
@@ -180,10 +180,10 @@
     int shm_id;			/* Descriptor to this shared memory */
     int i;
 
-    dprintf_info(shm,"shm_locate_MainBlock: trying to attach, key=0x%x\n",
+    TRACE(shm,"trying to attach, key=0x%x\n",
 		shm_key);
     for (i=0 ; i < SHM_KEY_RANGE ; i++) {
-       dprintf_info(shm,"iteration=%d\n", i);
+       TRACE(shm,"iteration=%d\n", i);
 
        shm_id= shmget ( shm_key+i, SHM_MINBLOCK ,0700);
 
@@ -202,7 +202,7 @@
 	    case ENOMEM:	   /* no free memory */
 	    case ENOENT:	   /* this key does not exist */
 	    default :
-	      dprintf_warn(shm,"shmget failed, errno=%d, %s\n",
+	      WARN(shm,"shmget failed, errno=%d, %s\n",
 		     errno, strerror(errno) );
 	      return 0;		   /* Failed */
 	  }
@@ -222,7 +222,7 @@
   int flags= 0700 | IPC_CREAT | IPC_EXCL;
   int i;
 
-  dprintf_info(shm,"creating shared memory\n");
+  TRACE(shm,"creating shared memory\n");
 
   /* try to allocate shared memory with key="Wine", size=SHM_MINBLOCK, */
   /* complete user permission */
@@ -232,12 +232,12 @@
 	break;
   }
   if (shm_id == -1) {
-     dprintf_warn(shm, "failed to create shared memory\n");
+     WARN(shm, "failed to create shared memory\n");
      return 0;
   }
-  dprintf_info(shm,"shared memory created, attaching\n");
+  TRACE(shm,"shared memory created, attaching\n");
   main_block=(struct shm_main_block*) shmat(shm_id, 0,0);
-  if (debugging_info(shm))
+  if (TRACE_ON(shm))
      print_shm_info(shm_id);
   main_shm_id= shm_id;
   shm_setup_main_block();
diff --git a/ipc/shm_semaph.c b/ipc/shm_semaph.c
index 6d021bb..3fbe0ad 100644
--- a/ipc/shm_semaph.c
+++ b/ipc/shm_semaph.c
@@ -28,7 +28,7 @@
   struct sembuf sop[2];
   int ret;
   
-  dprintf_info(sem,"shm_read_wait(%d)\n",semid);
+  TRACE(sem,"(%d)\n",semid);
   sop[0].sem_num=SEM_READ;
   sop[0].sem_op=1;		   /* add this read instance */
   sop[0].sem_flg=SEM_UNDO;	   /* undo in case process dies */
@@ -50,7 +50,7 @@
   struct sembuf sop[3];
   int ret;
   
-  dprintf_info(sem,"shm_write_wait(%d)\n",semid);
+  TRACE(sem,"(%d)\n",semid);
   sop[0].sem_num=SEM_READ;
   sop[0].sem_op=0;		   /* wait until no reading instance exist */
   sop[0].sem_flg=SEM_UNDO;		   
@@ -76,7 +76,7 @@
   struct sembuf sop[2];
   int ret;
 
-  dprintf_info(sem,"shm_write_signal(%d)\n",semid);
+  TRACE(sem,"(%d)\n",semid);
   sop[0].sem_num=SEM_READ;
   sop[0].sem_op=-1;	
   sop[0].sem_flg=IPC_NOWAIT | SEM_UNDO;	/* no reason to wait */
@@ -99,7 +99,7 @@
   struct sembuf sop[2];
   int ret;
 
-  dprintf_info(sem,"shm_read_signal(%d)\n",semid);
+  TRACE(sem,"(%d)\n",semid);
   sop[0].sem_num=SEM_READ;
   sop[0].sem_op=-1;	
   sop[0].sem_flg=IPC_NOWAIT | SEM_UNDO;	/* no reason to wait */
diff --git a/loader/module.c b/loader/module.c
index 8bc0783..7a8d585 100644
--- a/loader/module.c
+++ b/loader/module.c
@@ -19,6 +19,7 @@
 #include "module.h"
 #include "neexe.h"
 #include "process.h"
+#include "thread.h"
 #include "resource.h"
 #include "selectors.h"
 #include "stackframe.h"
@@ -29,6 +30,8 @@
 
 extern HINSTANCE16 PE_LoadModule( HFILE32 hf, OFSTRUCT *ofs, LOADPARAMS* params );
 
+extern BOOL32 THREAD_InitDone;
+
 static HMODULE16 hFirstModule = 0;
 static HMODULE16 hCachedModule = 0;  /* Module cached by MODULE_OpenFile */
 
@@ -269,7 +272,7 @@
     static int cachedfd = -1;
 
     hModule = MODULE_HANDLEtoHMODULE16(hModule);
-    dprintf_info(module, "MODULE_OpenFile(%04x) cache: mod=%04x fd=%d\n",
+    TRACE(module, "(%04x) cache: mod=%04x fd=%d\n",
                     hModule, hCachedModule, cachedfd );
     if (!(pModule = MODULE_GetPtr( hModule ))) return -1;
     if (hCachedModule == hModule) return cachedfd;
@@ -280,7 +283,7 @@
         (cachedfd = open( full_name.long_name, O_RDONLY )) == -1)
         fprintf( stderr, "MODULE_OpenFile: can't open file '%s' for module %04x\n",
                  name, hModule );
-    dprintf_info(module, "MODULE_OpenFile: opened '%s' -> %d\n",
+    TRACE(module, "opened '%s' -> %d\n",
                     name, cachedfd );
     return cachedfd;
 }
@@ -561,7 +564,7 @@
 
     /* Clear internal Wine flags in case they are set in the EXE file */
 
-    pModule->flags &= ~(NE_FFLAGS_BUILTIN | NE_FFLAGS_WIN32);
+    pModule->flags &= ~(NE_FFLAGS_BUILTIN|NE_FFLAGS_WIN32|NE_FFLAGS_IMPLICIT);
 
     /* Read the fast-load area */
 
@@ -569,7 +572,7 @@
     {
         fastload_offset=ne_header.fastload_offset<<ne_header.align_shift_count;
         fastload_length=ne_header.fastload_length<<ne_header.align_shift_count;
-        dprintf_info(module, "Using fast-load area offset=%x len=%d\n",
+        TRACE(module, "Using fast-load area offset=%x len=%d\n",
                         fastload_offset, fastload_length );
         if ((fastload = HeapAlloc( SystemHeap, 0, fastload_length )) != NULL)
         {
@@ -756,7 +759,7 @@
 
     if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
 
-    dprintf_info(module, "MODULE_GetOrdinal(%04x,'%s')\n",
+    TRACE(module, "(%04x,'%s')\n",
                     hModule, name );
 
       /* First handle names of the form '#xxxx' */
@@ -779,7 +782,7 @@
     {
         if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len ))
         {
-            dprintf_info(module, "  Found: ordinal=%d\n",
+            TRACE(module, "  Found: ordinal=%d\n",
                             *(WORD *)(cpnt + *cpnt + 1) );
             return *(WORD *)(cpnt + *cpnt + 1);
         }
@@ -797,7 +800,7 @@
     {
         if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len ))
         {
-            dprintf_info(module, "  Found: ordinal=%d\n",
+            TRACE(module, "  Found: ordinal=%d\n",
                             *(WORD *)(cpnt + *cpnt + 1) );
             return *(WORD *)(cpnt + *cpnt + 1);
         }
@@ -1044,7 +1047,7 @@
     if (ordinal) WEP = MODULE_GetEntryPoint( hModule, ordinal );
     if (!WEP)
     {
-	dprintf_warn(module, "module %04x doesn't have a WEP\n", hModule );
+	WARN(module, "module %04x doesn't have a WEP\n", hModule );
 	return FALSE;
     }
     return Callbacks->CallWindowsExitProc( WEP, WEP_FREE_DLL );
@@ -1307,7 +1310,7 @@
     NE_MODULE *pModule;
 
     if (!(pModule = MODULE_GetPtr( hModule ))) return FALSE;
-    dprintf_info(module, "FreeModule16: %s count %d\n", 
+    TRACE(module, "%s count %d\n", 
 		    MODULE_GetModuleName(hModule), pModule->count );
 
     return MODULE_FreeModule( hModule, GlobalLock16(GetCurrentTask()) );
@@ -1335,7 +1338,7 @@
 {
     HMODULE32	hModule;
 
-    dprintf_info(win32, "GetModuleHandleA: %s\n", module ? module : "NULL");
+    TRACE(win32, "%s\n", module ? module : "NULL");
 /* Freecell uses the result of GetModuleHandleA(0) as the hInstance in
 all calls to e.g. CreateWindowEx. */
     if (module == NULL) {
@@ -1364,7 +1367,7 @@
     NE_MODULE *pModule;
 
     if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
-    dprintf_info(module, "GetModuleUsage(%04x): returning %d\n",
+    TRACE(module, "(%04x): returning %d\n",
                     hModule, pModule->count );
     return pModule->count;
 }
@@ -1381,7 +1384,7 @@
     if (!hModule) hModule = GetCurrentTask();
     if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
     lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), nSize );
-    dprintf_info(module, "GetModuleFileName16: %s\n", lpFileName );
+    TRACE(module, "%s\n", lpFileName );
     return strlen(lpFileName);
 }
 
@@ -1401,7 +1404,7 @@
     }
     if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
     lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), size );
-    dprintf_info(module, "GetModuleFileName32A: %s\n", lpFileName );
+    TRACE(module, "%s\n", lpFileName );
     return strlen(lpFileName);
 }                   
  
@@ -1496,7 +1499,7 @@
  */
 BOOL32 WINAPI FreeLibrary32(HINSTANCE32 hLibModule)
 {
-	dprintf_info(module,"FreeLibrary: hLibModule: %08x\n", hLibModule);
+	TRACE(module,"hLibModule=%08x\n", hLibModule);
 	return MODULE_FreeModule(hLibModule, 
 	                         GlobalLock16(GetCurrentTask()) );
 }
@@ -1514,7 +1517,7 @@
         fprintf( stderr, "LoadLibrary not supported in Winelib\n" );
         return 0;
     }
-    dprintf_info(module, "LoadLibrary: (%08x) %s\n", (int)libname, libname);
+    TRACE(module, "(%08x) %s\n", (int)libname, libname);
 
     handle = MODULE_Load( libname, (LPVOID)-1, 0 );
     if (handle == (HINSTANCE16)2)  /* file not found */
@@ -1544,7 +1547,7 @@
  */
 void WINAPI FreeLibrary16( HINSTANCE16 handle )
 {
-    dprintf_info(module,"FreeLibrary: %04x\n", handle );
+    TRACE(module,"%04x\n", handle );
     FreeModule16( handle );
 }
 
@@ -1683,6 +1686,7 @@
 		int iconic = (nCmdShow == SW_SHOWMINIMIZED ||
 			      nCmdShow == SW_SHOWMINNOACTIVE);
 
+		THREAD_InitDone = FALSE; /* we didn't init this process */
 		/* get unixfilename */
 		if (strchr(filename, '/') ||
 		    strchr(filename, ':') ||
@@ -1758,16 +1762,16 @@
     hModule = MODULE_HANDLEtoHMODULE16(hModule);
     if (HIWORD(name)) {
         ordinal = MODULE_GetOrdinal( hModule, name );
-        dprintf_info(module, "WIN32_GetProcAddress16: %04x '%s'\n",
+        TRACE(module, "%04x '%s'\n",
                         hModule, name );
     } else {
         ordinal = LOWORD(name);
-        dprintf_info(module, "GetProcAddress: %04x %04x\n",
+        TRACE(module, "%04x %04x\n",
                         hModule, ordinal );
     }
     if (!ordinal) return (FARPROC16)0;
     ret = MODULE_GetEntryPoint( hModule, ordinal );
-    dprintf_info(module,"WIN32_GetProcAddress16: returning %08x\n",(UINT32)ret);
+    TRACE(module,"returning %08x\n",(UINT32)ret);
     return ret;
 }
 
@@ -1785,20 +1789,20 @@
     if (HIWORD(name) != 0)
     {
         ordinal = MODULE_GetOrdinal( hModule, (LPSTR)PTR_SEG_TO_LIN(name) );
-        dprintf_info(module, "GetProcAddress: %04x '%s'\n",
+        TRACE(module, "%04x '%s'\n",
                         hModule, (LPSTR)PTR_SEG_TO_LIN(name) );
     }
     else
     {
         ordinal = LOWORD(name);
-        dprintf_info(module, "GetProcAddress: %04x %04x\n",
+        TRACE(module, "%04x %04x\n",
                         hModule, ordinal );
     }
     if (!ordinal) return (FARPROC16)0;
 
     ret = MODULE_GetEntryPoint( hModule, ordinal );
 
-    dprintf_info(module, "GetProcAddress: returning %08x\n", (UINT32)ret );
+    TRACE(module, "returning %08x\n", (UINT32)ret );
     return ret;
 }
 
@@ -1811,9 +1815,9 @@
     NE_MODULE *pModule;
 
     if (HIWORD(function))
-	dprintf_info(win32,"GetProcAddress32(%08lx,%s)\n",(DWORD)hModule,function);
+	TRACE(win32,"(%08lx,%s)\n",(DWORD)hModule,function);
     else
-	dprintf_info(win32,"GetProcAddress32(%08lx,%p)\n",(DWORD)hModule,function);
+	TRACE(win32,"(%08lx,%p)\n",(DWORD)hModule,function);
     if (!(pModule = MODULE_GetPtr( hModule )))
         return (FARPROC32)0;
     if (!pModule->module32)
diff --git a/loader/ne_image.c b/loader/ne_image.c
index 7b13bab..c47fd4c 100644
--- a/loader/ne_image.c
+++ b/loader/ne_image.c
@@ -54,7 +54,7 @@
     if (!pSeg->filepos) return TRUE;  /* No file image, just return */
 	
     fd = MODULE_OpenFile( pModule->self );
-    dprintf_info(module, "Loading segment %d, selector=%04x, flags=%04x\n",
+    TRACE(module, "Loading segment %d, selector=%04x, flags=%04x\n",
                     segnum, pSeg->selector, pSeg->flags );
     lseek( fd, pSeg->filepos << pModule->alignment, SEEK_SET );
     if (pSeg->size) size = pSeg->size;
@@ -115,7 +115,7 @@
       /*
 	 The following bit of code for "iterated segments" was written without
 	 any documentation on the format of these segments. It seems to work,
-	 but may be missing something. If you have any doco please either send
+	 but may be missing something. If you have any doc please either send
 	 it to me or fix the code yourself. gfm@werple.mira.net.au
       */
       char* buff = xmalloc(size);
@@ -142,7 +142,7 @@
     read( fd, &count, sizeof(count) );
     if (!count) return TRUE;
 
-    dprintf_info(fixup, "Fixups for %*.*s, segment %d, selector %04x\n",
+    TRACE(fixup, "Fixups for %*.*s, segment %d, selector %04x\n",
                    *((BYTE *)pModule + pModule->name_table),
                    *((BYTE *)pModule + pModule->name_table),
                    (char *)pModule + pModule->name_table + 1,
@@ -152,12 +152,12 @@
     if (read( fd, reloc_entries, count * sizeof(struct relocation_entry_s)) !=
             count * sizeof(struct relocation_entry_s))
     {
-        dprintf_warn(fixup, "Unable to read relocation information\n" );
+        WARN(fixup, "Unable to read relocation information\n" );
         return FALSE;
     }
 
     /*
-     * Go through the relocation table on entry at a time.
+     * Go through the relocation table one entry at a time.
      */
     rep = reloc_entries;
     for (i = 0; i < count; i++, rep++)
@@ -193,10 +193,10 @@
                             (char *)pTarget + pTarget->name_table + 1,
                             ordinal );
             }
-            if (debugging_info(fixup))
+            if (TRACE_ON(fixup))
             {
                 NE_MODULE *pTarget = MODULE_GetPtr( module );
-                dprintf_info(fixup, "%d: %*.*s.%d=%04x:%04x\n", i + 1, 
+                TRACE(fixup, "%d: %*.*s.%d=%04x:%04x\n", i + 1, 
 			     *((BYTE *)pTarget + pTarget->name_table),
 			     *((BYTE *)pTarget + pTarget->name_table),
 			     (char *)pTarget + pTarget->name_table + 1,
@@ -214,17 +214,17 @@
 
             address = MODULE_GetEntryPoint( module, ordinal );
 
-            if (debugging_err(fixup) && !address)
+            if (ERR_ON(fixup) && !address)
             {
                 NE_MODULE *pTarget = MODULE_GetPtr( module );
-                dprintf_err(fixup, "Warning: no handler for %.*s.%s, setting to 0:0\n",
+                ERR(fixup, "Warning: no handler for %.*s.%s, setting to 0:0\n",
 			    *((BYTE *)pTarget + pTarget->name_table),
 			    (char *)pTarget + pTarget->name_table + 1, func_name );
             }
-            if (debugging_info(fixup))
+            if (TRACE_ON(fixup))
             {
 	        NE_MODULE *pTarget = MODULE_GetPtr( module );
-                dprintf_info(fixup, "%d: %.*s.%s=%04x:%04x\n", i + 1, 
+                TRACE(fixup, "%d: %.*s.%s=%04x:%04x\n", i + 1, 
 			     *((BYTE *)pTarget + pTarget->name_table),
 			     (char *)pTarget + pTarget->name_table + 1,
 			     func_name, HIWORD(address), LOWORD(address) );
@@ -241,7 +241,7 @@
                 address = (FARPROC16)PTR_SEG_OFF_TO_SEGPTR( pSegTable[rep->target1-1].selector, rep->target2 );
 	    }
 	    
-	    dprintf_info(fixup,"%d: %04x:%04x\n", 
+	    TRACE(fixup,"%d: %04x:%04x\n", 
 			  i + 1, HIWORD(address), LOWORD(address) );
 	    break;
 
@@ -254,14 +254,13 @@
 	     * successfully emulate the coprocessor if it doesn't
 	     * exist.
 	     */
-	    dprintf_info(fixup,
-                   "%d: ADDR TYPE %d,  TYPE %d,  OFFSET %04x,  TARGET %04x %04x\n",
-		   i + 1, rep->address_type, rep->relocation_type, 
-		   rep->offset, rep->target1, rep->target2);
+	    TRACE(fixup, "%d: ADDR TYPE %d,  TYPE %d,  OFFSET %04x,  "
+			 "TARGET %04x %04x\n", i + 1, rep->address_type, 
+			 rep->relocation_type, rep->offset, rep->target1, rep->target2);
 	    continue;
 	    
 	  default:
-	    dprintf_warn(fixup, "WARNING: %d: ADDR TYPE %d,  "
+	    WARN(fixup, "WARNING: %d: ADDR TYPE %d,  "
 			  "unknown TYPE %d, OFFSET %04x, TARGET %04x %04x\n",
 			  i + 1, rep->address_type, rep->relocation_type, 
 			  rep->offset, rep->target1, rep->target2);
@@ -282,7 +281,7 @@
 	  case NE_RADDR_LOWBYTE:
             do {
                 sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
-                dprintf_info(fixup,"    %04x:%04x:%04x BYTE%s\n",
+                TRACE(fixup,"    %04x:%04x:%04x BYTE%s\n",
                               pSeg->selector, offset, *sp, additive ? " additive":"");
                 offset = *sp;
 		if(additive)
@@ -296,7 +295,7 @@
 	  case NE_RADDR_OFFSET16:
 	    do {
                 sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
-		dprintf_info(fixup,"    %04x:%04x:%04x OFFSET16%s\n",
+		TRACE(fixup,"    %04x:%04x:%04x OFFSET16%s\n",
                               pSeg->selector, offset, *sp, additive ? " additive" : "" );
 		offset = *sp;
 		*sp = LOWORD(address);
@@ -308,7 +307,7 @@
 	  case NE_RADDR_POINTER32:
 	    do {
                 sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
-		dprintf_info(fixup,"    %04x:%04x:%04x POINTER32%s\n",
+		TRACE(fixup,"    %04x:%04x:%04x POINTER32%s\n",
                               pSeg->selector, offset, *sp, additive ? " additive" : "" );
 		offset = *sp;
 		*sp    = LOWORD(address);
@@ -321,7 +320,7 @@
 	  case NE_RADDR_SELECTOR:
 	    do {
                 sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
-		dprintf_info(fixup,"    %04x:%04x:%04x SELECTOR%s\n",
+		TRACE(fixup,"    %04x:%04x:%04x SELECTOR%s\n",
                               pSeg->selector, offset, *sp, additive ? " additive" : "" );
 		offset = *sp;
 		*sp    = HIWORD(address);
@@ -334,10 +333,10 @@
 	    break;
 	    
 	  default:
-	    dprintf_warn(fixup, "WARNING: %d: unknown ADDR TYPE %d,  "
-			  "TYPE %d,  OFFSET %04x,  TARGET %04x %04x\n",
-		   i + 1, rep->address_type, rep->relocation_type, 
-		   rep->offset, rep->target1, rep->target2);
+	    WARN(fixup, "WARNING: %d: unknown ADDR TYPE %d,  "
+			 "TYPE %d,  OFFSET %04x,  TARGET %04x %04x\n",
+			 i + 1, rep->address_type, rep->relocation_type, 
+			 rep->offset, rep->target1, rep->target2);
 	    free(reloc_entries);
 	    return FALSE;
 	}
@@ -367,9 +366,9 @@
         DWORD oldstack;
         WORD saved_dgroup = pSegTable[pModule->dgroup - 1].selector;
 
-        dprintf_info(module, "NE_LoadAllSegments: %.*s is a self-loading module!\n",
-                       *((BYTE*)pModule + pModule->name_table),
-                       (char *)pModule + pModule->name_table + 1);
+        TRACE(module, "%.*s is a self-loading module!\n",
+		     *((BYTE*)pModule + pModule->name_table),
+		     (char *)pModule + pModule->name_table + 1);
         if (!NE_LoadSegment( pModule, 1 )) return FALSE;
         selfloadheader = (SELFLOADHEADER *)
                           PTR_SEG_OFF_TO_LIN(pSegTable->selector, 0);
@@ -424,7 +423,7 @@
         BYTE *pstr = (BYTE *)pModule + pModule->import_table + *pModRef;
         memcpy( buffer, pstr + 1, *pstr );
         strcpy( buffer + *pstr, ".dll" );
-        dprintf_info(module, "Loading '%s'\n", buffer );
+        TRACE(module, "Loading '%s'\n", buffer );
         if (!(*pModRef = MODULE_FindModule( buffer )))
         {
             /* If the DLL is not loaded yet, load it and store */
@@ -482,7 +481,7 @@
     if (pModule->flags & NE_FFLAGS_SINGLEDATA)
         dgroup = pSegTable[pModule->dgroup-1].selector;
 
-    dprintf_info(module, "MODULE_FixupPrologs(%04x)\n", pModule->self );
+    TRACE(module, "(%04x)\n", pModule->self );
     p = (BYTE *)pModule + pModule->entry_table;
     while (*p)
     {
@@ -517,7 +516,7 @@
 		fixup_ptr = (char *)GET_SEL_BASE(pSegTable[sel-1].selector) + 
 		  *(WORD *)(p + 1);
 	    }
-	    dprintf_info(module, "%s Signature: %02x %02x %02x,ff %x\n",
+	    TRACE(module, "%s Signature: %02x %02x %02x,ff %x\n",
 			    dbg_str(module), fixup_ptr[0], fixup_ptr[1], 
 			    fixup_ptr[2], pModule->flags );
             if (*p & 0x0001)
@@ -549,11 +548,11 @@
 			}
                     }
                 } else {
-		    dprintf_warn(fixup, "Unknown signature\n" );
+		    WARN(fixup, "Unknown signature\n" );
 		}
             }
 	    else
-	      dprintf_info(module,"\n");
+	      TRACE(module,"\n");
             p += (sel == 0xff) ? 6 : 3;  
         }
     }
@@ -635,7 +634,7 @@
 
 
     pModule->cs = 0;  /* Don't initialize it twice */
-    dprintf_info(dll, "Calling LibMain, cs:ip=%04lx:%04x ds=%04lx di=%04x cx=%04x\n", 
+    TRACE(dll, "Calling LibMain, cs:ip=%04lx:%04x ds=%04lx di=%04x cx=%04x\n", 
                  CS_reg(&context), IP_reg(&context), DS_reg(&context),
                  DI_reg(&context), CX_reg(&context) );
     Callbacks->CallRegisterShortProc( &context, 0 );
diff --git a/loader/ne_resource.c b/loader/ne_resource.c
index b091411..005f828 100644
--- a/loader/ne_resource.c
+++ b/loader/ne_resource.c
@@ -46,13 +46,13 @@
 	pNameInfo = (NE_NAMEINFO *)(pTypeInfo + 1);
 	for (count = pTypeInfo->count; count > 0; count--, pNameInfo++)
 	{
-            dprintf_info(resource, "NameTable entry: type=%04x id=%04x\n",
+            TRACE(resource, "NameTable entry: type=%04x id=%04x\n",
                               pTypeInfo->type_id, pNameInfo->id );
             handle = LoadResource16( pModule->self, 
 				   (HRSRC16)((int)pNameInfo - (int)pModule) );
             for(p = (WORD*)LockResource16(handle); p && *p; p = (WORD *)((char*)p+*p))
             {
-                dprintf_info(resource,"  type=%04x '%s' id=%04x '%s'\n",
+                TRACE(resource,"  type=%04x '%s' id=%04x '%s'\n",
                                   p[1], (char *)(p+3), p[2],
                                   (char *)(p+3)+strlen((char *)(p+3))+1 );
                 /* Check for correct type */
@@ -80,7 +80,7 @@
 
                 /* If we get here, we've found the entry */
 
-                dprintf_info(resource, "  Found!\n" );
+                TRACE(resource, "  Found!\n" );
                 ret = MAKELONG( p[1], p[2] );
                 break;
             }
@@ -112,11 +112,11 @@
 		BYTE *p = (BYTE*)pModule + pModule->res_table + pTypeInfo->type_id;
 		if ((*p == len) && !lstrncmpi32A( p+1, str, len ))
 		{
-		    dprintf_info(resource, "  Found type '%s'\n", str );
+		    TRACE(resource, "  Found type '%s'\n", str );
 		    return pTypeInfo;
 		}
 	    }
-	    dprintf_info(resource, "  Skipping type %04x\n", pTypeInfo->type_id );
+	    TRACE(resource, "  Skipping type %04x\n", pTypeInfo->type_id );
 	    pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
 	}
     }
@@ -127,10 +127,10 @@
 	{
             if (pTypeInfo->type_id == id)
 	    {
-		dprintf_info(resource, "  Found type %04x\n", id );
+		TRACE(resource, "  Found type %04x\n", id );
 		return pTypeInfo;
 	    }
-	    dprintf_info(resource, "  Skipping type %04x\n", pTypeInfo->type_id );
+	    TRACE(resource, "  Skipping type %04x\n", pTypeInfo->type_id );
 	    pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
 	}
     }
@@ -188,9 +188,9 @@
 	WORD sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
 	NE_NAMEINFO* pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
 
-        dprintf_info(resource, "NEResourceHandler: loading, pos=%d, len=%d\n",
-                         (int)pNameInfo->offset << sizeShift,
-                         (int)pNameInfo->length << sizeShift );
+        TRACE(resource, "loading, pos=%d, len=%d\n",
+		     (int)pNameInfo->offset << sizeShift,
+		     (int)pNameInfo->length << sizeShift );
 	if( hMemObj )
 	    handle = GlobalReAlloc16( hMemObj, pNameInfo->length << sizeShift, 0 );
 	else
@@ -216,7 +216,7 @@
     NE_MODULE *pModule = MODULE_GetPtr( hModule );
     NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
 
-    dprintf_info(resource,"InitResourceHandler[%04x]\n", hModule );
+    TRACE(resource,"InitResourceHandler[%04x]\n", hModule );
 
     while(pTypeInfo->type_id)
     {
@@ -279,15 +279,15 @@
 	    hRsrc = NE_FindResourceFromType(pModule, pTypeInfo, resId);
 	    if( hRsrc )
 	    {
-		dprintf_info(resource, "    Found id %08lx\n", resId );
+		TRACE(resource, "    Found id %08lx\n", resId );
 		return hRsrc;
 	    }
-	    dprintf_info(resource, "    Not found, going on\n" );
+	    TRACE(resource, "    Not found, going on\n" );
 	    pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
 	}
     } while( pTypeInfo );
 
-    dprintf_warn(resource, "failed!\n");
+    WARN(resource, "failed!\n");
     return 0;
 }
 
@@ -388,7 +388,7 @@
 	    && !(GlobalFlags16(pNameInfo->handle) & GMEM_DISCARDED))
 	{
 	    pNameInfo->usage++;
-	    dprintf_info(resource, "  Already loaded, new count=%d\n",
+	    TRACE(resource, "  Already loaded, new count=%d\n",
 			      pNameInfo->usage );
 	}
 	else
@@ -459,8 +459,8 @@
         pTypeInfo = (NE_TYPEINFO *)pNameInfo;
     }
 
-    dprintf_info(resource, "NE_FreeResource[%04x]: no intrinsic resource for %04x\n", 
-			      hModule, handle );
+    TRACE(resource, "[%04x]: no intrinsic resource for %04x\n", 
+		 hModule, handle );
     GlobalFree16( handle ); /* it could have been DirectResAlloc()'ed */
     return handle;
 }
diff --git a/loader/pe_image.c b/loader/pe_image.c
index 842c7f7..e1923f1 100644
--- a/loader/pe_image.c
+++ b/loader/pe_image.c
@@ -74,20 +74,19 @@
   IMAGE_EXPORT_DIRECTORY *pe_exports = (IMAGE_EXPORT_DIRECTORY*)RVA(rva_start);
 
   Module = (char*)RVA(pe_exports->Name);
-  dprintf_info(win32,"\n*******EXPORT DATA*******\nModule name is %s, %ld functions, %ld names\n", 
-	 Module,
-	 pe_exports->NumberOfFunctions,
-	 pe_exports->NumberOfNames);
+  TRACE(win32,"*******EXPORT DATA*******\n");
+  TRACE(win32,"Module name is %s, %ld functions, %ld names\n", 
+	       Module, pe_exports->NumberOfFunctions, pe_exports->NumberOfNames);
 
   ordinal=(u_short*) RVA(pe_exports->AddressOfNameOrdinals);
   functions=function=(u_long*) RVA(pe_exports->AddressOfFunctions);
   name=(u_char**) RVA(pe_exports->AddressOfNames);
 
-  dprintf_info(win32," Ord    RVA     Addr   Name\n" );
+  TRACE(win32," Ord    RVA     Addr   Name\n" );
   for (i=0;i<pe_exports->NumberOfFunctions;i++, function++)
   {
       if (!*function) continue;  /* No such function */
-      if (debugging_info(win32)){
+      if (TRACE_ON(win32)){
 	dbg_decl_str(win32, 1024);
 
 	dsprintf(win32,"%4ld %08lx %08x",
@@ -98,7 +97,7 @@
 	    dsprintf(win32, "  %s", (char*)RVA(name[j]) );
 	if ((*function >= rva_start) && (*function <= rva_end))
 	  dsprintf(win32, " (forwarded -> %s)", (char *)RVA(*function));
-	dprintf_info(win32,"%s\n", dbg_str(win32));
+	TRACE(win32,"%s\n", dbg_str(win32));
       }
   }
 }
@@ -135,9 +134,9 @@
 	exports   = pem->pe_export;
 
 	if (HIWORD(funcName))
-		dprintf_info(win32,"PE_FindExportedFunction(%s)\n",funcName);
+		TRACE(win32,"(%s)\n",funcName);
 	else
-		dprintf_info(win32,"PE_FindExportedFunction(%d)\n",(int)funcName);
+		TRACE(win32,"(%d)\n",(int)funcName);
 	if (!exports) {
 		fprintf(stderr,"Module %08x/MODREF %p doesn't have a exports table.\n",hModule,pem);
 		return NULL;
@@ -168,7 +167,7 @@
 		}
 	} else {
 		if (LOWORD(funcName)-exports->Base > exports->NumberOfFunctions) {
-			dprintf_info(win32,"	ordinal %d out of range!\n",
+			TRACE(win32,"	ordinal %d out of range!\n",
                                       LOWORD(funcName));
 			return NULL;
 		}
@@ -192,7 +191,7 @@
 	return NULL;
 }
 
-DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
+DWORD fixup_imports (PDB32 *process,PE_MODREF *pem)
 {
     IMAGE_IMPORT_DESCRIPTOR	*pe_imp;
     int	fixup_failed		= 0;
@@ -206,12 +205,12 @@
         modname = "<unknown>";
 
     /* OK, now dump the import list */
-    dprintf_info(win32, "\nDumping imports list\n");
+    TRACE(win32, "Dumping imports list\n");
 
     /* first, count the number of imported non-internal modules */
     pe_imp = pem->pe_import;
     if (!pe_imp) 
-    	fprintf(stderr,"no import directory????\n");
+    	ERR(win32, "no import directory????\n");
 
     /* FIXME: should terminate on 0 Characteristics */
     for (i = 0; pe_imp->Name; pe_imp++)
@@ -232,14 +231,18 @@
 	/* don't use MODULE_Load, Win32 creates new task differently */
 	res = PE_LoadLibraryEx32A( name, process, 0, 0 );
 	if (res <= (HMODULE32) 32) {
-	    char *p, buffer[1024];
+	    char buffer[1024];
 
 	    /* Try with prepending the path of the current module */
-	    GetModuleFileName32A( hModule, buffer, sizeof (buffer));
-	    if (!(p = strrchr (buffer, '\\')))
-		p = buffer;
-	    strcpy (p + 1, name);
-	    res = PE_LoadLibraryEx32A( buffer, process, 0, 0 );
+	    if (GetModuleFileName32A( pem->module, buffer, sizeof (buffer))) {
+	        char *p;
+
+		if (!(p = strrchr (buffer, '\\')))
+		    p = buffer;
+		strcpy (p + 1, name);
+		res = PE_LoadLibraryEx32A( buffer, process, 0, 0 );
+	    } else
+	    	ERR(win32,"cannot find the module just loaded!\n");
 	}
 	if (res <= (HMODULE32) 32) {
 	    fprintf (stderr, "Module %s not found\n", name);
@@ -285,12 +288,12 @@
 
 	Module = (char *) RVA(pe_imp->Name);
         hImpModule = MODULE_HANDLEtoHMODULE32( MODULE_FindModule(Module) );
-	dprintf_info(win32, "%s\n", Module);
+	TRACE(win32, "%s\n", Module);
 
 	/* FIXME: forwarder entries ... */
 
 	if (pe_imp->u.OriginalFirstThunk != 0) { /* original MS style */
-	    dprintf_info(win32, "Microsoft style imports used\n");
+	    TRACE(win32, "Microsoft style imports used\n");
 	    import_list =(LPIMAGE_THUNK_DATA) RVA(pe_imp->u.OriginalFirstThunk);
 	    thunk_list = (LPIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk);
 
@@ -298,7 +301,7 @@
 		if (IMAGE_SNAP_BY_ORDINAL(import_list->u1.Ordinal)) {
 		    int ordinal = IMAGE_ORDINAL(import_list->u1.Ordinal);
 
-		    dprintf_info(win32, "--- Ordinal %s,%d\n", Module, ordinal);
+		    TRACE(win32, "--- Ordinal %s,%d\n", Module, ordinal);
 		    thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
                         process, hImpModule, (LPCSTR)ordinal);
 		    if (!thunk_list->u1.Function) {
@@ -308,7 +311,7 @@
 		    }
 		} else {		/* import by name */
 		    pe_name = (LPIMAGE_IMPORT_BY_NAME)RVA(import_list->u1.AddressOfData);
-		    dprintf_info(win32, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
+		    TRACE(win32, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
 		    thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
                         process, hImpModule, pe_name->Name);
 		    if (!thunk_list->u1.Function) {
@@ -321,14 +324,14 @@
 		thunk_list++;
 	    }
 	} else {	/* Borland style */
-	    dprintf_info(win32, "Borland style imports used\n");
+	    TRACE(win32, "Borland style imports used\n");
 	    thunk_list = (LPIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk);
 	    while (thunk_list->u1.Ordinal) {
 		if (IMAGE_SNAP_BY_ORDINAL(thunk_list->u1.Ordinal)) {
 		    /* not sure about this branch, but it seems to work */
 		    int ordinal = IMAGE_ORDINAL(thunk_list->u1.Ordinal);
 
-		    dprintf_info(win32,"--- Ordinal %s.%d\n",Module,ordinal);
+		    TRACE(win32,"--- Ordinal %s.%d\n",Module,ordinal);
 		    thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
                         process, hImpModule, (LPCSTR) ordinal);
 		    if (!thunk_list->u1.Function) {
@@ -338,7 +341,7 @@
 		    }
 		} else {
 		    pe_name=(LPIMAGE_IMPORT_BY_NAME) RVA(thunk_list->u1.AddressOfData);
-		    dprintf_info(win32,"--- %s %s.%d\n",
+		    TRACE(win32,"--- %s %s.%d\n",
 		   		  pe_name->Name,Module,pe_name->Hint);
 		    thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
                         process, hImpModule, pe_name->Name );
@@ -362,11 +365,11 @@
     int i,vma_size = 0;
     IMAGE_SECTION_HEADER *pe_seg = PE_SECTIONS(hModule);
 
-    dprintf_info(win32, "Dump of segment table\n");
-    dprintf_info(win32, "   Name    VSz  Vaddr     SzRaw   Fileadr  *Reloc *Lineum #Reloc #Linum Char\n");
+    TRACE(win32, "Dump of segment table\n");
+    TRACE(win32, "   Name    VSz  Vaddr     SzRaw   Fileadr  *Reloc *Lineum #Reloc #Linum Char\n");
     for (i = 0; i< PE_HEADER(hModule)->FileHeader.NumberOfSections; i++)
     {
-        dprintf_info(win32, "%8s: %4.4lx %8.8lx %8.8lx %8.8lx %8.8lx %8.8lx %4.4x %4.4x %8.8lx\n", 
+        TRACE(win32, "%8s: %4.4lx %8.8lx %8.8lx %8.8lx %8.8lx %8.8lx %4.4x %4.4x %8.8lx\n", 
                       pe_seg->Name, 
                       pe_seg->Misc.VirtualSize,
                       pe_seg->VirtualAddress,
@@ -401,14 +404,14 @@
 		char *page = (char*) RVA(r->VirtualAddress);
 		int count = (r->SizeOfBlock - 8)/2;
 		int i;
-		dprintf_info(fixup, "%x relocations for page %lx\n",
+		TRACE(fixup, "%x relocations for page %lx\n",
 			count, r->VirtualAddress);
 		/* patching in reverse order */
 		for(i=0;i<count;i++)
 		{
 			int offset = r->TypeOffset[i] & 0xFFF;
 			int type = r->TypeOffset[i] >> 12;
-			dprintf_info(fixup,"patching %x type %x\n", offset, type);
+			TRACE(fixup,"patching %x type %x\n", offset, type);
 			switch(type)
 			{
 			case IMAGE_REL_BASED_ABSOLUTE: break;
@@ -545,7 +548,7 @@
 
 	load_addr = nt_header->OptionalHeader.ImageBase;
 	vma_size = calc_vma_size( hModule );
-	dprintf_info(win32, "Load addr is %lx\n",load_addr);
+	TRACE(win32, "Load addr is %lx\n",load_addr);
 	load_addr = (DWORD)VirtualAlloc( (void*)load_addr, vma_size,
                                          MEM_RESERVE | MEM_COMMIT,
                                          PAGE_EXECUTE_READWRITE );
@@ -559,7 +562,7 @@
 	 */
 	pem->module = *phModule = (HMODULE32)load_addr;
 
-	dprintf_info(win32, "Load addr is really %lx, range %x\n",
+	TRACE(win32, "Load addr is really %lx, range %x\n",
                       load_addr, vma_size);
 	
         /* Store the NT header at the load addr
@@ -635,10 +638,10 @@
 	}
 
 	if(nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size)
-		dprintf_fixme(win32,"Exception directory ignored\n");
+		FIXME(win32,"Exception directory ignored\n");
 
 	if(nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY].Size)
-		dprintf_fixme(win32,"Security directory ignored\n");
+		FIXME(win32,"Security directory ignored\n");
 
 
 
@@ -652,34 +655,34 @@
 
 	if(nt_header->OptionalHeader.DataDirectory
 		[IMAGE_DIRECTORY_ENTRY_COPYRIGHT].Size)
-		dprintf_fixme(win32,"Copyright string ignored\n");
+		FIXME(win32,"Copyright string ignored\n");
 
 	if(nt_header->OptionalHeader.DataDirectory
 		[IMAGE_DIRECTORY_ENTRY_GLOBALPTR].Size)
-		dprintf_fixme(win32,"Global Pointer (MIPS) ignored\n");
+		FIXME(win32,"Global Pointer (MIPS) ignored\n");
 
 	if(nt_header->OptionalHeader.DataDirectory
 		[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].Size)
-		dprintf_fixme(win32,"Load Configuration directory ignored\n");
+		FIXME(win32,"Load Configuration directory ignored\n");
 
 	if(nt_header->OptionalHeader.DataDirectory
 		[IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT].Size)
-		dprintf_fixme(win32,"Bound Import directory ignored\n");
+		FIXME(win32,"Bound Import directory ignored\n");
 
 	if(nt_header->OptionalHeader.DataDirectory
 		[IMAGE_DIRECTORY_ENTRY_IAT].Size)
-		dprintf_fixme(win32,"Import Address Table directory ignored\n");
+		FIXME(win32,"Import Address Table directory ignored\n");
 	if(nt_header->OptionalHeader.DataDirectory[13].Size)
-		dprintf_fixme(win32,"Unknown directory 13 ignored\n");
+		FIXME(win32,"Unknown directory 13 ignored\n");
 	if(nt_header->OptionalHeader.DataDirectory[14].Size)
-		dprintf_fixme(win32,"Unknown directory 14 ignored\n");
+		FIXME(win32,"Unknown directory 14 ignored\n");
 	if(nt_header->OptionalHeader.DataDirectory[15].Size)
-		dprintf_fixme(win32,"Unknown directory 15 ignored\n");
+		FIXME(win32,"Unknown directory 15 ignored\n");
 
 	if(pem->pe_reloc)	do_relocations(pem);
 	if(pem->pe_export)	dump_exports(pem->module);
 	if(pem->pe_import)	{
-		if (fixup_imports(process,pem,hModule)) {
+		if (fixup_imports(process,pem)) {
 			PE_MODREF	**xpem;
 
 			/* remove entry from modref chain */
@@ -869,7 +872,7 @@
     ) {
         FARPROC32 entry = (FARPROC32)RVA_PTR( pem->module,
                                           OptionalHeader.AddressOfEntryPoint );
-        dprintf_info(relay, "CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n",
+        TRACE(relay, "CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n",
                        entry, pem->module, type, lpReserved );
         entry( pem->module, type, lpReserved );
     }
diff --git a/loader/resource.c b/loader/resource.c
index 8d7ad81..3219d78 100644
--- a/loader/resource.c
+++ b/loader/resource.c
@@ -45,7 +45,7 @@
 	char *ptr = PTR_SEG_TO_LIN( name );
 	if (ptr[0] == '#')
 	    if (!(name = (SEGPTR)atoi( ptr + 1 ))) {
-	      dprintf_warn(resource, "Incorrect resource name: %s\n", ptr);
+	      WARN(resource, "Incorrect resource name: %s\n", ptr);
 	      return 0;
 	    }
     }
@@ -55,12 +55,12 @@
 	char *ptr = PTR_SEG_TO_LIN( type );
 	if (ptr[0] == '#')
 	  if (!(type = (SEGPTR)atoi( ptr + 1 ))){
-	    dprintf_warn(resource, "Incorrect resource type: %s\n", ptr);
+	    WARN(resource, "Incorrect resource type: %s\n", ptr);
 	    return 0;
 	  }
     }
 
-    dprintf_info(resource, "FindResource16: module=%04x name=%s type=%s\n", 
+    TRACE(resource, "module=%04x name=%s type=%s\n", 
 		 hModule, debugres(PTR_SEG_TO_LIN(name)), 
 		 debugres(PTR_SEG_TO_LIN(type)) );
 
@@ -125,7 +125,7 @@
 
         if (!hModule) hModule = GetTaskDS();
         hModule = MODULE_HANDLEtoHMODULE32( hModule );
-        dprintf_info(resource, "FindResource32W: module=%08x "
+        TRACE(resource, "module=%08x "
 			 "type=%s%p name=%s%p\n", hModule,
 			 (HIWORD(type))? "" : "#", type, 
 			 (HIWORD(name))? "" : "#", name);
@@ -154,7 +154,7 @@
     NE_MODULE *pModule;
 
     hModule = MODULE_HANDLEtoHMODULE16( hModule );
-    dprintf_info(resource, "LoadResource16: module=%04x res=%04x\n",
+    TRACE(resource, "module=%04x res=%04x\n",
                      hModule, hRsrc );
     if (!hRsrc) return 0;
     if ((pModule = MODULE_GetPtr( hModule )))
@@ -182,7 +182,7 @@
 
         if (!hModule) hModule = GetTaskDS(); /* FIXME: see FindResource32W */
         hModule = MODULE_HANDLEtoHMODULE32( hModule );
-        dprintf_info(resource, "LoadResource32: module=%04x res=%04x\n",
+        TRACE(resource, "module=%04x res=%04x\n",
                          hModule, hRsrc );
         if (!hRsrc) return 0;
 
@@ -207,7 +207,7 @@
     HMODULE16 hModule;
     NE_MODULE *pModule;
 
-    dprintf_info(resource, "LockResource: handle=%04x\n", handle );
+    TRACE(resource, "handle=%04x\n", handle );
     if (!handle) return (SEGPTR)0;
     hModule = MODULE_HANDLEtoHMODULE16( handle );
     if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@@ -227,7 +227,7 @@
         HMODULE16 hModule;
         NE_MODULE *pModule;
 
-        dprintf_info(resource, "LockResource: handle=%04x\n", handle );
+        TRACE(resource, "handle=%04x\n", handle );
         if (!handle) return NULL;
         hModule = MODULE_HANDLEtoHMODULE16( handle );
         if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@@ -261,7 +261,7 @@
         HMODULE16 hModule;
         NE_MODULE *pModule;
 
-        dprintf_info(resource, "FreeResource16: handle=%04x\n", handle );
+        TRACE(resource, "handle=%04x\n", handle );
         if (!handle) return FALSE;
         hModule = MODULE_HANDLEtoHMODULE16( handle );
         if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@@ -293,7 +293,7 @@
     NE_MODULE *pModule;
 
     hModule = MODULE_HANDLEtoHMODULE16( hModule );
-    dprintf_info(resource, "AccessResource16: module=%04x res=%04x\n",
+    TRACE(resource, "module=%04x res=%04x\n",
                      hModule, hRsrc );
     if (!hRsrc) return 0;
     if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@@ -316,7 +316,7 @@
 INT32 WINAPI AccessResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
 {
     hModule = MODULE_HANDLEtoHMODULE32( hModule );
-    dprintf_info(resource, "AccessResource: module=%04x res=%04x\n",
+    TRACE(resource, "module=%04x res=%04x\n",
                      hModule, hRsrc );
     if (!hRsrc) return 0;
     fprintf(stderr,"AccessResource32: not implemented\n");
@@ -332,7 +332,7 @@
     NE_MODULE *pModule;
 
     hModule = MODULE_HANDLEtoHMODULE16( hModule );
-    dprintf_info(resource, "SizeofResource16: module=%04x res=%04x\n",
+    TRACE(resource, "module=%04x res=%04x\n",
                      hModule, hRsrc );
     if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
     if (!__winelib)
@@ -354,7 +354,7 @@
 DWORD WINAPI SizeofResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
 {
     hModule = MODULE_HANDLEtoHMODULE32( hModule );
-    dprintf_info(resource, "SizeofResource32: module=%04x res=%04x\n",
+    TRACE(resource, "module=%04x res=%04x\n",
                      hModule, hRsrc );
     if (!__winelib) return PE_SizeofResource32(hModule,hRsrc);
     else
@@ -373,7 +373,7 @@
     NE_MODULE *pModule;
 
     hModule = MODULE_HANDLEtoHMODULE16( hModule );
-    dprintf_info(resource, "AllocResource: module=%04x res=%04x size=%ld\n",
+    TRACE(resource, "module=%04x res=%04x size=%ld\n",
                      hModule, hRsrc, size );
     if (!hRsrc) return 0;
     if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@@ -397,7 +397,7 @@
 HGLOBAL16 WINAPI DirectResAlloc( HINSTANCE16 hInstance, WORD wType,
                                  UINT16 wSize )
 {
-    dprintf_info(resource,"DirectResAlloc(%04x,%04x,%04x)\n",
+    TRACE(resource,"(%04x,%04x,%04x)\n",
                      hInstance, wType, wSize );
     hInstance = MODULE_HANDLEtoHMODULE16(hInstance);
     if(!hInstance)return 0;
@@ -416,10 +416,10 @@
     HRSRC16	hRsrc;
 
     if (HIWORD(lpTableName))
-        dprintf_info(accel, "LoadAccelerators: %04x '%s'\n",
+        TRACE(accel, "%04x '%s'\n",
                       instance, (char *)PTR_SEG_TO_LIN( lpTableName ) );
     else
-        dprintf_info(accel, "LoadAccelerators: %04x %04x\n",
+        TRACE(accel, "%04x %04x\n",
                        instance, LOWORD(lpTableName) );
 
     if (!(hRsrc = FindResource16( instance, lpTableName, RT_ACCELERATOR )))
@@ -441,10 +441,10 @@
     HRSRC32 hRsrc;
 
     if (HIWORD(lpTableName))
-        dprintf_info(accel, "LoadAccelerators: %04x '%s'\n",
+        TRACE(accel, "%04x '%s'\n",
                       instance, (char *)( lpTableName ) );
     else
-        dprintf_info(accel, "LoadAccelerators: %04x %04x\n",
+        TRACE(accel, "%04x %04x\n",
                        instance, LOWORD(lpTableName) );
 
     if (!(hRsrc = FindResource32W( instance, lpTableName, 
@@ -505,7 +505,7 @@
     int string_num;
     int i;
 
-    dprintf_info(resource,"LoadString: inst=%04x id=%04x buff=%08x len=%d\n",
+    TRACE(resource,"inst=%04x id=%04x buff=%08x len=%d\n",
                      instance, resource_id, (int) buffer, buflen);
 
     hrsrc = FindResource16( instance, (SEGPTR)((resource_id>>4)+1), RT_STRING );
@@ -518,7 +518,7 @@
     for (i = 0; i < string_num; i++)
 	p += *p + 1;
     
-    dprintf_info(resource, "strlen = %d\n", (int)*p );
+    TRACE(resource, "strlen = %d\n", (int)*p );
     
     i = MIN(buflen - 1, *p);
     if (buffer == NULL)
@@ -536,7 +536,7 @@
     }
     FreeResource16( hmem );
 
-    dprintf_info(resource,"LoadString // '%s' copied !\n", buffer);
+    TRACE(resource,"'%s' copied !\n", buffer);
     return i;
 }
 
@@ -554,7 +554,7 @@
 
     if (HIWORD(resource_id)==0xFFFF) /* netscape 3 passes this */
 	resource_id = (UINT32)(-((INT32)resource_id));
-    dprintf_info(resource, "LoadString: instance = %04x, id = %04x, buffer = %08x, "
+    TRACE(resource, "instance = %04x, id = %04x, buffer = %08x, "
 	   "length = %d\n", instance, (int)resource_id, (int) buffer, buflen);
 
     hrsrc = FindResource32W( instance, (LPCWSTR)((resource_id>>4)+1), 
@@ -568,7 +568,7 @@
     for (i = 0; i < string_num; i++)
 	p += *p + 1;
     
-    dprintf_info(resource, "strlen = %d\n", (int)*p );
+    TRACE(resource, "strlen = %d\n", (int)*p );
     
     i = MIN(buflen - 1, *p);
     if (buffer == NULL)
@@ -587,7 +587,7 @@
 #endif
     }
 #if 0
-    dprintf_info(resource,"LoadString // '%s' copied !\n", buffer);
+    TRACE(resource,"'%s' copied !\n", buffer);
 #endif
     return i;
 }
@@ -658,7 +658,7 @@
 	CHAR	str[1];
     } *stre;
 
-    dprintf_info(resource, "LoadMessage: instance = %08lx, id = %08lx, buffer = %p, length = %ld\n", (DWORD)instance, (DWORD)id, buffer, (DWORD)buflen);
+    TRACE(resource, "instance = %08lx, id = %08lx, buffer = %p, length = %ld\n", (DWORD)instance, (DWORD)id, buffer, (DWORD)buflen);
 
     /*FIXME: I am not sure about the '1' ... But I've only seen those entries*/
     hrsrc = FindResourceEx32W(instance,(LPWSTR)1,(LPCWSTR)RT_MESSAGELIST,lang);
@@ -686,7 +686,7 @@
     	stre = (struct _stringentry*)(((char*)stre)+slen);
     }
     slen=stre->len;
-    dprintf_info(resource,"	- strlen=%d\n",slen);
+    TRACE(resource,"	- strlen=%d\n",slen);
     i = MIN(buflen - 1, slen);
     if (buffer == NULL)
 	return slen; /* different to LoadString */
@@ -700,7 +700,7 @@
 	}
     }
     if (buffer)
-	    dprintf_info(resource,"LoadMessage // '%s' copied !\n", buffer);
+	    TRACE(resource,"'%s' copied !\n", buffer);
     return i;
 }
 
@@ -737,7 +737,7 @@
 
     hModule = GetExePtr( hModule );
 
-    dprintf_info(resource, "SetResourceHandler: module=%04x type=%s\n", 
+    TRACE(resource, "module=%04x type=%s\n", 
 		 hModule, debugres(PTR_SEG_TO_LIN(s)) );
 
     if ((pModule = MODULE_GetPtr( hModule )))
diff --git a/loader/signal.c b/loader/signal.c
index 0092b22..ef850ad 100644
--- a/loader/signal.c
+++ b/loader/signal.c
@@ -26,6 +26,8 @@
 #endif
 
 #include "miscemu.h"
+#include "selectors.h"
+#include "sig_context.h"
 #include "winsock.h"
 
 
@@ -83,8 +85,9 @@
  * 
  * wait4 terminated child processes
  */
-static void SIGNAL_child(void)
+static HANDLER_DEF(SIGNAL_child)
 {
+    HANDLER_INIT();
 #ifdef HAVE_WAIT4
     wait4( 0, NULL, WNOHANG, NULL);
 #elif defined (HAVE_WAITPID)
diff --git a/loader/task.c b/loader/task.c
index ce56b0a..bda4626 100644
--- a/loader/task.c
+++ b/loader/task.c
@@ -176,9 +176,9 @@
     /* Display it */
 
     p = (char *) GlobalLock16( handle );
-    dprintf_info(task, "Master DOS environment at %p\n", p);
-    for (; *p; p += strlen(p) + 1) dprintf_info(task, "    %s\n", p);
-    dprintf_info(task, "Progname: %s\n", p+3 );
+    TRACE(task, "Master DOS environment at %p\n", p);
+    for (; *p; p += strlen(p) + 1) TRACE(task, "    %s\n", p);
+    TRACE(task, "Progname: %s\n", p+3 );
 
     return handle;
 }
@@ -347,7 +347,7 @@
 
         InitApp( pTask->hModule );
         PE_InitializeDLLs( PROCESS_Current(), DLL_PROCESS_ATTACH, (LPVOID)-1 );
-        dprintf_info(relay, "CallTo32(entryproc=%p)\n", entry );
+        TRACE(relay, "(entryproc=%p)\n", entry );
         exit_code = entry();
         TASK_KillCurrentTask( exit_code );
     }
@@ -376,7 +376,7 @@
         ECX_reg(&context) = pModule->heap_size;
         EDI_reg(&context) = context.SegDs;
 
-        dprintf_info(task, "Starting main program: cs:ip=%04lx:%04x ds=%04lx ss:sp=%04x:%04x\n",
+        TRACE(task, "Starting main program: cs:ip=%04lx:%04x ds=%04lx ss:sp=%04x:%04x\n",
                       CS_reg(&context), IP_reg(&context), DS_reg(&context),
                       SELECTOROF(pTask->thdb->cur_stack),
                       OFFSETOF(pTask->thdb->cur_stack) );
@@ -563,7 +563,7 @@
 
     TASK_LinkTask( hTask );
 
-    dprintf_info(task, "CreateTask: module='%s' cmdline='%s' task=%04x\n",
+    TRACE(task, "module='%s' cmdline='%s' task=%04x\n",
                   name, cmdLine, hTask );
 
     return hTask;
@@ -621,7 +621,7 @@
     TDB* pTask = (TDB*) GlobalLock16( hCurrentTask );
     if (!pTask) USER_ExitWindows();  /* No current task yet */
 
-    dprintf_info(task, "Killing task %04x\n", hCurrentTask );
+    TRACE(task, "Killing task %04x\n", hCurrentTask );
 
     /* Delete active sockets */
 
@@ -643,7 +643,7 @@
 
     if (nTaskCount <= 1)
     {
-        dprintf_info(task, "\nthis is the last task, exiting\n" );
+        TRACE(task, "this is the last task, exiting\n" );
         USER_ExitWindows();
     }
 
@@ -724,7 +724,7 @@
         {
             pNewTask = (TDB *)GlobalLock16( hTask );
 
-	    dprintf_info(task, "\ttask = %04x, events = %i\n", hTask, pNewTask->nEvents);
+	    TRACE(task, "\ttask = %04x, events = %i\n", hTask, pNewTask->nEvents);
 
             if (pNewTask->nEvents) break;
             hTask = pNewTask->hNext;
@@ -739,11 +739,11 @@
 
     if (hTask == hCurrentTask) 
     {
-       dprintf_info(task, "returning to the current task(%04x)\n", hTask );
+       TRACE(task, "returning to the current task(%04x)\n", hTask );
        return;  /* Nothing to do */
     }
     pNewTask = (TDB *)GlobalLock16( hTask );
-    dprintf_info(task, "Switching to task %04x (%.8s)\n",
+    TRACE(task, "Switching to task %04x (%.8s)\n",
                   hTask, pNewTask->module_name );
 
      /* Make the task the last in the linked list (round-robin scheduling) */
@@ -1012,7 +1012,7 @@
     thunk = PTR_SEG_TO_LIN( thunkaddr );
     lfunc = PTR_SEG_TO_LIN( func );
 
-    dprintf_info(task, "MakeProcInstance(%08lx,%04x): got thunk %08lx\n",
+    TRACE(task, "(%08lx,%04x): got thunk %08lx\n",
                   (DWORD)func, hInstance, (DWORD)thunkaddr );
     if (((lfunc[0]==0x8c) && (lfunc[1]==0xd8)) ||
     	((lfunc[0]==0x1e) && (lfunc[1]==0x58))
@@ -1036,7 +1036,7 @@
  */
 void WINAPI FreeProcInstance16( FARPROC16 func )
 {
-    dprintf_info(task, "FreeProcInstance(%08lx)\n", (DWORD)func );
+    TRACE(task, "(%08lx)\n", (DWORD)func );
     if (!__winelib) TASK_FreeThunk( hCurrentTask, (SEGPTR)func );
 }
 
@@ -1118,7 +1118,7 @@
 
     if (!(pTask = (TDB *)GlobalLock16( hCurrentTask ))) return;
     if (!(pData = (INSTANCEDATA *)GlobalLock16( seg ))) return;
-    dprintf_info(task, "SwitchStackTo: old=%04x:%04x new=%04x:%04x\n",
+    TRACE(task, "old=%04x:%04x new=%04x:%04x\n",
                   SELECTOROF( pTask->thdb->cur_stack ),
                   OFFSETOF( pTask->thdb->cur_stack ), seg, ptr );
 
@@ -1167,8 +1167,8 @@
         fprintf( stderr, "SwitchStackBack: no previous SwitchStackTo\n" );
         return;
     }
-    dprintf_info(task, "SwitchStackBack: restoring stack %04x:%04x\n",
-                  SELECTOROF(pData->old_ss_sp), OFFSETOF(pData->old_ss_sp) );
+    TRACE(task, "restoring stack %04x:%04x\n",
+		 SELECTOROF(pData->old_ss_sp), OFFSETOF(pData->old_ss_sp) );
 
     oldFrame = (STACK16FRAME *)PTR_SEG_TO_LIN( pTask->thdb->cur_stack );
 
@@ -1181,7 +1181,7 @@
 
     newFrame = (STACK16FRAME *)PTR_SEG_TO_LIN( pTask->thdb->cur_stack );
     newFrame->frame32 = oldFrame->frame32;
-    if (debugging_info(relay))
+    if (TRACE_ON(relay))
     {
         newFrame->entry_ip = oldFrame->entry_ip;
         newFrame->entry_cs = oldFrame->entry_cs;
@@ -1446,7 +1446,7 @@
     TDB *pTask;
     INSTANCEDATA *pInstData;
 
-    dprintf_info(toolhelp, "TaskNext(%p): task=%04x\n", lpte, lpte->hNext );
+    TRACE(toolhelp, "(%p): task=%04x\n", lpte, lpte->hNext );
     if (!lpte->hNext) return FALSE;
     pTask = (TDB *)GlobalLock16( lpte->hNext );
     if (!pTask || pTask->magic != TDB_MAGIC) return FALSE;
diff --git a/memory/global.c b/memory/global.c
index af33ce0..960e3da 100644
--- a/memory/global.c
+++ b/memory/global.c
@@ -186,7 +186,7 @@
     HGLOBAL16 handle;
     SHMDATA shmdata;
 
-    dprintf_info(global, "GlobalAlloc: %ld flags=%04x\n", size, flags );
+    TRACE(global, "%ld flags=%04x\n", size, flags );
 
     /* If size is 0, create a discarded block */
 
@@ -293,7 +293,7 @@
     GLOBALARENA *pArena, *pNewArena;
     WORD sel = GlobalHandleToSel( handle );
 
-    dprintf_info(global, "GlobalReAlloc16: %04x %ld flags=%04x\n",
+    TRACE(global, "%04x %ld flags=%04x\n",
                     handle, size, flags );
     if (!handle) return 0;
     
@@ -350,7 +350,7 @@
 
     ptr = (void *)pArena->base;
     oldsize = pArena->size;
-    dprintf_info(global,"oldsize %08lx\n",oldsize);
+    TRACE(global,"oldsize %08lx\n",oldsize);
     if (ptr && (size == oldsize)) return handle;  /* Nothing to do */
 
     ptr = HeapReAlloc( SystemHeap, 0, ptr, size );
@@ -409,7 +409,7 @@
     }
     ptr = (void *)GET_ARENA_PTR(handle)->base;
 
-    dprintf_info(global, "GlobalFree16: %04x\n", handle );
+    TRACE(global, "%04x\n", handle );
     if (!GLOBAL_FreeBlock( handle )) return handle;  /* failed */
 #ifdef CONFIG_IPC
     if (is_dde_handle(handle)) return DDE_GlobalFree(handle);
@@ -426,7 +426,7 @@
  */
 SEGPTR WINAPI WIN16_GlobalLock16( HGLOBAL16 handle )
 {
-    dprintf_info(global, "WIN16_GlobalLock16(%04x) -> %08lx\n",
+    TRACE(global, "(%04x) -> %08lx\n",
                     handle, MAKELONG( 0, GlobalHandleToSel(handle)) );
     if (handle)
     {
@@ -478,7 +478,7 @@
 	fprintf(stderr,"Invalid handle 0x%04x passed to GlobalUnlock16!\n",handle);
 	return 0;
     }
-    dprintf_info(global, "GlobalUnlock16: %04x\n", handle );
+    TRACE(global, "%04x\n", handle );
     if (pArena->lockCount) pArena->lockCount--;
     return pArena->lockCount;
 }
@@ -489,7 +489,7 @@
  */
 DWORD WINAPI GlobalSize16( HGLOBAL16 handle )
 {
-    dprintf_info(global, "GlobalSize16: %04x\n", handle );
+    TRACE(global, "%04x\n", handle );
     if (!handle) return 0;
     if (!VALID_HANDLE(handle))
 	return 0;
@@ -502,7 +502,7 @@
  */
 DWORD WINAPI GlobalHandle16( WORD sel )
 {
-    dprintf_info(global, "GlobalHandle16: %04x\n", sel );
+    TRACE(global, "%04x\n", sel );
     if (!VALID_HANDLE(sel)) {
 	fprintf(stderr,"Invalid handle 0x%04x passed to GlobalHandle16!\n",sel);
 	return 0;
@@ -530,7 +530,7 @@
 {
     GLOBALARENA *pArena;
 
-    dprintf_info(global, "GlobalFlags16: %04x\n", handle );
+    TRACE(global, "%04x\n", handle );
     if (!VALID_HANDLE(handle)) {
 	fprintf(stderr,"Invalid handle 0x%04x passed to GlobalFlags16!\n",handle);
 	return 0;
@@ -547,7 +547,7 @@
  */
 HGLOBAL16 WINAPI LockSegment16( HGLOBAL16 handle )
 {
-    dprintf_info(global, "LockSegment: %04x\n", handle );
+    TRACE(global, "%04x\n", handle );
     if (handle == (HGLOBAL16)-1) handle = CURRENT_DS;
     if (!VALID_HANDLE(handle)) {
 	fprintf(stderr,"Invalid handle 0x%04x passed to LockSegment16!\n",handle);
@@ -563,7 +563,7 @@
  */
 void WINAPI UnlockSegment16( HGLOBAL16 handle )
 {
-    dprintf_info(global, "UnlockSegment: %04x\n", handle );
+    TRACE(global, "%04x\n", handle );
     if (handle == (HGLOBAL16)-1) handle = CURRENT_DS;
     if (!VALID_HANDLE(handle)) {
 	fprintf(stderr,"Invalid handle 0x%04x passed to UnlockSegment16!\n",handle);
@@ -623,7 +623,7 @@
  */
 LONG WINAPI SetSwapAreaSize16( WORD size )
 {
-    dprintf_fixme(global, "STUB: SetSwapAreaSize(%d)\n", size );
+    FIXME(global, "(%d) - stub!\n", size );
     return MAKELONG( size, 0xffff );
 }
 
@@ -633,7 +633,7 @@
  */
 HGLOBAL16 WINAPI GlobalLRUOldest( HGLOBAL16 handle )
 {
-    dprintf_info(global, "GlobalLRUOldest: %04x\n", handle );
+    TRACE(global, "%04x\n", handle );
     if (handle == (HGLOBAL16)-1) handle = CURRENT_DS;
     return handle;
 }
@@ -644,7 +644,7 @@
  */
 HGLOBAL16 WINAPI GlobalLRUNewest( HGLOBAL16 handle )
 {
-    dprintf_info(global, "GlobalLRUNewest: %04x\n", handle );
+    TRACE(global, "%04x\n", handle );
     if (handle == (HGLOBAL16)-1) handle = CURRENT_DS;
     return handle;
 }
@@ -702,7 +702,7 @@
  */
 WORD WINAPI GlobalPageLock( HGLOBAL16 handle )
 {
-    dprintf_info(global, "GlobalPageLock: %04x\n", handle );
+    TRACE(global, "%04x\n", handle );
     if (!VALID_HANDLE(handle)) {
 	fprintf(stderr,"Invalid handle 0x%04x passed to GlobalPageLock!\n",handle);
 	return 0;
@@ -716,7 +716,7 @@
  */
 WORD WINAPI GlobalPageUnlock( HGLOBAL16 handle )
 {
-    dprintf_info(global, "GlobalPageUnlock: %04x\n", handle );
+    TRACE(global, "%04x\n", handle );
     if (!VALID_HANDLE(handle)) {
 	fprintf(stderr,"Invalid handle 0x%04x passed to GlobalPageUnlock!\n",handle);
 	return 0;
@@ -730,7 +730,7 @@
  */
 void WINAPI GlobalFix16( HGLOBAL16 handle )
 {
-    dprintf_info(global, "GlobalFix16: %04x\n", handle );
+    TRACE(global, "%04x\n", handle );
     if (!VALID_HANDLE(handle)) {
 	fprintf(stderr,"Invalid handle 0x%04x passed to GlobalFix16!\n",handle);
 	return;
@@ -744,7 +744,7 @@
  */
 void WINAPI GlobalUnfix16( HGLOBAL16 handle )
 {
-    dprintf_info(global, "GlobalUnfix16: %04x\n", handle );
+    TRACE(global, "%04x\n", handle );
     if (!VALID_HANDLE(handle)) {
 	fprintf(stderr,"Invalid handle 0x%04x passed to GlobalUnfix16!\n",handle);
 	return;
@@ -784,7 +784,7 @@
  */
 WORD WINAPI GlobalHandleToSel( HGLOBAL16 handle )
 {
-    dprintf_info(toolhelp, "GlobalHandleToSel: %04x\n", handle );
+    TRACE(toolhelp, "%04x\n", handle );
     if (!handle) return 0;
 #ifdef CONFIG_IPC
     if (is_dde_handle(handle)) return DDE_GlobalHandleToSel(handle);
@@ -1029,7 +1029,7 @@
    }
    else
    {
-      dprintf_warn(global, "GlobalLock32: invalid handle\n");
+      WARN(global, "invalid handle\n");
       palloc=(LPVOID) NULL;
    }
    /* HeapUnlock(GetProcessHeap()); */;
@@ -1060,7 +1060,7 @@
    }
    else
    {
-      dprintf_warn(global, "GlobalUnlock32: invalid handle\n");
+      WARN(global, "invalid handle\n");
       locked=FALSE;
    }
    /* HeapUnlock(GetProcessHeap()); */
@@ -1233,7 +1233,7 @@
       }
       else
       {
-	 dprintf_warn(global, "GlobalSize32: invalid handle\n");
+	 WARN(global, "invalid handle\n");
 	 retval=0;
       }
       /* HeapUnlock(GetProcessHeap()); */
@@ -1302,7 +1302,7 @@
       }
       else
       {
-	 dprintf_warn(global,"GlobalFlags32: invalid handle\n");
+	 WARN(global,"invalid handle\n");
 	 retval=0;
       }
       /* HeapUnlock(GetProcessHeap()); */
diff --git a/memory/heap.c b/memory/heap.c
index 6499172..e657d38 100644
--- a/memory/heap.c
+++ b/memory/heap.c
@@ -188,7 +188,7 @@
         SetLastError( ERROR_INVALID_HANDLE );
         return NULL;
     }
-    if (debugging_info(heap) && !HeapValidate( heap, 0, NULL ))
+    if (TRACE_ON(heap) && !HeapValidate( heap, 0, NULL ))
     {
         HEAP_Dump( heapPtr );
         assert( FALSE );
@@ -302,7 +302,7 @@
 
     /* If debugging, erase the freed block content */
 
-    if (debugging_info(heap))
+    if (TRACE_ON(heap))
     {
         char *pEnd = (char *)ptr + size;
         if (pEnd > (char *)subheap + subheap->commitSize)
@@ -321,7 +321,7 @@
         pNext->next->prev = pNext->prev;
         pNext->prev->next = pNext->next;
         size += (pNext->size & ARENA_SIZE_MASK) + sizeof(*pNext);
-        if (debugging_info(heap))
+        if (TRACE_ON(heap))
             memset( pNext, ARENA_FREE_FILLER, sizeof(ARENA_FREE) );
     }
 
@@ -540,7 +540,7 @@
     subheap->next = heap->subheap.next;
     heap->subheap.next = subheap;
     size = subheap->size;
-    dprintf_info(heap, "HEAP_FindFreeBlock: created new sub-heap %08lx of %08lx bytes for heap %08lx\n",
+    TRACE(heap, "created new sub-heap %08lx of %08lx bytes for heap %08lx\n",
                   (DWORD)subheap, size, (DWORD)heap );
 
     HEAP_CreateFreeBlock( subheap, subheap + 1, size - sizeof(*subheap) );
@@ -850,7 +850,7 @@
     HEAP *heapPtr = HEAP_GetPtr( heap );
     SUBHEAP *subheap;
 
-    dprintf_info(heap, "HeapDestroy: %08x\n", heap );
+    TRACE(heap, "%08x\n", heap );
     if (!heapPtr) return FALSE;
 
     DeleteCriticalSection( &heapPtr->critSection );
@@ -889,7 +889,7 @@
 
     if (!(pArena = HEAP_FindFreeBlock( heapPtr, size, &subheap )))
     {
-        dprintf_info(heap, "HeapAlloc(%08x,%08lx,%08lx): returning NULL\n",
+        TRACE(heap, "(%08x,%08lx,%08lx): returning NULL\n",
                   heap, flags, size  );
         if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
         SetLastError( ERROR_COMMITMENT_LIMIT );
@@ -915,11 +915,11 @@
     HEAP_ShrinkBlock( subheap, pInUse, size );
 
     if (flags & HEAP_ZERO_MEMORY) memset( pInUse + 1, 0, size );
-    else if (debugging_info(heap)) memset( pInUse + 1, ARENA_INUSE_FILLER, size );
+    else if (TRACE_ON(heap)) memset( pInUse + 1, ARENA_INUSE_FILLER, size );
 
     if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
 
-    dprintf_info(heap, "HeapAlloc(%08x,%08lx,%08lx): returning %08lx\n",
+    TRACE(heap, "(%08x,%08lx,%08lx): returning %08lx\n",
                   heap, flags, size, (DWORD)(pInUse + 1) );
     return (LPVOID)(pInUse + 1);
 }
@@ -944,7 +944,7 @@
     {
         if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
         SetLastError( ERROR_INVALID_PARAMETER );
-        dprintf_info(heap, "HeapFree(%08x,%08lx,%08lx): returning FALSE\n",
+        TRACE(heap, "(%08x,%08lx,%08lx): returning FALSE\n",
                       heap, flags, (DWORD)ptr );
         return FALSE;
     }
@@ -958,7 +958,7 @@
     if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
 /*    SetLastError( 0 ); */
 
-    dprintf_info(heap, "HeapFree(%08x,%08lx,%08lx): returning TRUE\n",
+    TRACE(heap, "(%08x,%08lx,%08lx): returning TRUE\n",
                   heap, flags, (DWORD)ptr );
     return TRUE;
 }
@@ -990,7 +990,7 @@
     {
         if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
         SetLastError( ERROR_INVALID_PARAMETER );
-        dprintf_info(heap, "HeapReAlloc(%08x,%08lx,%08lx,%08lx): returning NULL\n",
+        TRACE(heap, "(%08x,%08lx,%08lx,%08lx): returning NULL\n",
                       heap, flags, (DWORD)ptr, size );
         return NULL;
     }
@@ -1064,7 +1064,7 @@
         if (flags & HEAP_ZERO_MEMORY)
             memset( (char *)(pArena + 1) + oldSize, 0,
                     (pArena->size & ARENA_SIZE_MASK) - oldSize );
-        else if (debugging_info(heap))
+        else if (TRACE_ON(heap))
             memset( (char *)(pArena + 1) + oldSize, ARENA_INUSE_FILLER,
                     (pArena->size & ARENA_SIZE_MASK) - oldSize );
     }
@@ -1074,7 +1074,7 @@
     pArena->callerEIP = *((DWORD *)&heap - 1);  /* hack hack */
     if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
 
-    dprintf_info(heap, "HeapReAlloc(%08x,%08lx,%08lx,%08lx): returning %08lx\n",
+    TRACE(heap, "(%08x,%08lx,%08lx,%08lx): returning %08lx\n",
                   heap, flags, (DWORD)ptr, size, (DWORD)(pArena + 1) );
     return (LPVOID)(pArena + 1);
 }
@@ -1137,7 +1137,7 @@
     }
     if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
 
-    dprintf_info(heap, "HeapSize(%08x,%08lx,%08lx): returning %08lx\n",
+    TRACE(heap, "(%08x,%08lx,%08lx): returning %08lx\n",
                   heap, flags, (DWORD)ptr, ret );
     return ret;
 }
diff --git a/memory/ldt.c b/memory/ldt.c
index 55a2875..64b8dd6 100644
--- a/memory/ldt.c
+++ b/memory/ldt.c
@@ -147,15 +147,14 @@
 {
     int ret = 0;
 
-    dprintf_info(ldt,
-	  "LDT_SetEntry: entry=%04x base=%08lx limit=%05lx %s %d-bit flags=%c%c%c\n",
-          entry, content->base, content->limit,
-          content->limit_in_pages ? "pages" : "bytes",
-          content->seg_32bit ? 32 : 16,
-          content->read_only && (content->type & SEGMENT_CODE) ? '-' : 'r',
-          content->read_only || (content->type & SEGMENT_CODE) ? '-' : 'w',
-          (content->type & SEGMENT_CODE) ? 'x' : '-' );
-
+    TRACE(ldt, "entry=%04x base=%08lx limit=%05lx %s %d-bit "
+		 "flags=%c%c%c\n", entry, content->base, content->limit,
+		 content->limit_in_pages ? "pages" : "bytes",
+		 content->seg_32bit ? 32 : 16,
+		 content->read_only && (content->type & SEGMENT_CODE) ? '-' : 'r',
+		 content->read_only || (content->type & SEGMENT_CODE) ? '-' : 'w',
+		 (content->type & SEGMENT_CODE) ? 'x' : '-' );
+    
     /* Entry 0 must not be modified; its base and limit are always 0 */
     if (!entry) return 0;
 
diff --git a/memory/local.c b/memory/local.c
index 2ebca30..479d382 100644
--- a/memory/local.c
+++ b/memory/local.c
@@ -125,7 +125,7 @@
 {
     LOCALHEAPINFO *pInfo;
     INSTANCEDATA *ptr = (INSTANCEDATA *)PTR_SEG_OFF_TO_LIN( ds, 0 );
-    dprintf_info(local, "Heap at %p, %04x\n", ptr, ptr->heap );
+    TRACE(local, "Heap at %p, %04x\n", ptr, ptr->heap );
     if (!ptr || !ptr->heap) return NULL;
     if (IsBadReadPtr16( (SEGPTR)MAKELONG(ptr->heap,ds), sizeof(LOCALHEAPINFO)))
         return NULL;
@@ -163,7 +163,7 @@
         next = pNext->next;
     }
 
-    dprintf_info(local, "Local_MakeBlockFree %04x, next %04x\n", block, next );
+    TRACE(local, "Local_MakeBlockFree %04x, next %04x\n", block, next );
       /* Insert the free block in the free-list */
 
     pArena->free_prev = pNext->free_prev;
@@ -228,7 +228,7 @@
 
       /* Remove the block from the free-list */
 
-    dprintf_info(local, "Local_RemoveBlock\n");
+    TRACE(local, "Local_RemoveBlock\n");
     pArena = ARENA_PTR( baseptr, block );
     if ((pArena->prev & 3) == LOCAL_ARENA_FREE)
         LOCAL_RemoveFreeBlock( baseptr, block );
@@ -258,8 +258,8 @@
 
     /* FIXME - the test should be done when calling the function! 
                plus is not clear that we should print this info
-               only when debugging_info is on! */
-    if(!debugging_info(local)) return;
+               only when TRACE_ON is on! */
+    if(!TRACE_ON(local)) return;
 
     ptr = PTR_SEG_OFF_TO_LIN( ds, 0 );
     pInfo = LOCAL_GetHeap( ds );
@@ -327,12 +327,12 @@
       /* - large free block    (FREE)       */
       /* - last arena          (FREE)       */
 
-    dprintf_info(local, "LocalInit: %04x %04x-%04x\n", selector, start, end);
+    TRACE(local, "%04x %04x-%04x\n", selector, start, end);
     if (!selector) selector = CURRENT_DS;
 
-    if (debugging_info(heap))
+    if (TRACE_ON(heap))
     {
-        /* If debugging_info(heap) is set, the global heap blocks are */
+        /* If TRACE_ON(heap) is set, the global heap blocks are */
         /* cleared before use, so we can test for double initialization. */
         if (LOCAL_GetHeap(selector))
         {
@@ -355,7 +355,7 @@
 		start = GlobalSize16( GlobalHandle16( selector ) );
 		start -= end;
 		end += start;
-		dprintf_info(local," new start %04x, minstart: %04x\n", start, pSeg->minsize + pModule->stack_size);
+		TRACE(local," new start %04x, minstart: %04x\n", start, pSeg->minsize + pModule->stack_size);
 	    }
 	}
     }
@@ -477,7 +477,7 @@
         pHeapInfo->items--;
     }
 
-    dprintf_info(local, "Heap expanded\n" );
+    TRACE(local, "Heap expanded\n" );
     LOCAL_PrintHeap( ds );
 }
 
@@ -491,7 +491,7 @@
     LOCALHEAPINFO *pInfo;
     LOCALARENA *pArena, *pPrev, *pNext;
 
-    dprintf_info(local, "LocalFreeArena: %04x ds=%04x\n", arena, ds );
+    TRACE(local, "%04x ds=%04x\n", arena, ds );
     if (!(pInfo = LOCAL_GetHeap( ds ))) return arena;
 
     pArena = ARENA_PTR( ptr, arena );
@@ -660,16 +660,15 @@
         LOCAL_PrintHeap(ds);
         return 0;
     }
-    dprintf_info(local,
-                  "LOCAL_Compact: ds = %04x, minfree = %04x, flags = %04x\n",
-                  ds, minfree, flags);
+    TRACE(local, "ds = %04x, minfree = %04x, flags = %04x\n",
+		 ds, minfree, flags);
     freespace = LOCAL_GetFreeSpace(ds, minfree ? 0 : 1);
     if(freespace >= minfree || (flags & LMEM_NOCOMPACT))
     {
-        dprintf_info(local, "Returning %04x.\n", freespace);
+        TRACE(local, "Returning %04x.\n", freespace);
         return freespace;
     }
-    dprintf_info(local, "Local_Compact: Compacting heap %04x.\n", ds);
+    TRACE(local, "Compacting heap %04x.\n", ds);
     table = pInfo->htable;
     while(table)
     {
@@ -679,9 +678,8 @@
             if((pEntry->lock == 0) && (pEntry->flags != (LMEM_DISCARDED >> 8)))
             {
                 /* OK we can move this one if we want */
-                dprintf_info(local,
-                              "handle %04x (block %04x) can be moved.\n",
-                              (WORD)((char *)pEntry - ptr), pEntry->addr);
+                TRACE(local, "handle %04x (block %04x) can be moved.\n",
+			     (WORD)((char *)pEntry - ptr), pEntry->addr);
                 movearena = ARENA_HEADER(pEntry->addr);
                 pMoveArena = ARENA_PTR(ptr, movearena);
                 movesize = pMoveArena->next - movearena;
@@ -707,7 +705,7 @@
                 }
                 if (finalarena) /* Actually got somewhere to move */
                 {
-                    dprintf_info(local, "Moving it to %04x.\n", finalarena);
+                    TRACE(local, "Moving it to %04x.\n", finalarena);
                     pFinalArena = ARENA_PTR(ptr, finalarena);
                     size = pFinalArena->size;
                     LOCAL_RemoveFreeBlock(ptr, finalarena);
@@ -738,7 +736,7 @@
     freespace = LOCAL_GetFreeSpace(ds, minfree ? 0 : 1);
     if(freespace >= minfree || (flags & LMEM_NODISCARD))
     {
-        dprintf_info(local, "Returning %04x.\n", freespace);
+        TRACE(local, "Returning %04x.\n", freespace);
         return freespace;
     }
 
@@ -751,7 +749,7 @@
             if(pEntry->addr && pEntry->lock == 0 &&
 	     (pEntry->flags & (LMEM_DISCARDABLE >> 8)))
 	    {
-                dprintf_info(local, "Discarding handle %04x (block %04x).\n",
+                TRACE(local, "Discarding handle %04x (block %04x).\n",
                               (char *)pEntry - ptr, pEntry->addr);
                 LOCAL_FreeArena(ds, ARENA_HEADER(pEntry->addr));
                 pEntry->addr = 0;
@@ -790,7 +788,7 @@
 	if (arena == pArena->free_next) break;
         if (pArena->size >= size) return arena;
     }
-    dprintf_warn(local, "Local_FindFreeBlock: not enough space\n" );
+    WARN(local, "not enough space\n" );
     LOCAL_PrintHeap(ds);
     return 0;
 }
@@ -833,24 +831,21 @@
     }
     if (arena == 0) {
         if (ds == GDI_HeapSel) { 
-	    dprintf_warn(local, 
-	       "Local_GetBlock: not enough space in GDI local heap (%04x) for %d bytes\n",
-		     ds, size );
+	    WARN(local, "not enough space in GDI local heap "
+			 "(%04x) for %d bytes\n", ds, size );
 	} else if (ds == USER_HeapSel) {
-	    dprintf_warn(local, 
-	       "Local_GetBlock: not enough space in USER local heap (%04x) for %d bytes\n",
-		     ds, size );
+	    WARN(local, "not enough space in USER local heap "
+			 "(%04x) for %d bytes\n", ds, size );
 	} else {
-	    dprintf_warn(local, 
-	       "Local_GetBlock: not enough space in local heap %04x for %d bytes\n",
-		     ds, size );
+	    WARN(local, "not enough space in local heap "
+			 "%04x for %d bytes\n", ds, size );
 	}
 	return 0;
     }
 
       /* Make a block out of the free arena */
     pArena = ARENA_PTR( ptr, arena );
-    dprintf_info(local, "LOCAL_GetBlock size = %04x, arena %04x size %04x\n",
+    TRACE(local, "LOCAL_GetBlock size = %04x, arena %04x size %04x\n",
                   size, arena, pArena->size );
     LOCAL_RemoveFreeBlock( ptr, arena );
     LOCAL_ShrinkArena( ds, arena, size );
@@ -872,7 +867,7 @@
     HLOCAL16 handle;
     int i;
 
-    dprintf_info(local, "Local_NewHTable\n" );
+    TRACE(local, "Local_NewHTable\n" );
     if (!(pInfo = LOCAL_GetHeap( ds )))
     {
         fprintf( stderr, "Local heap not found\n");
@@ -944,7 +939,7 @@
 
     pEntry->lock = 0;
     pEntry->flags = 0;
-    dprintf_info(local, "LOCAL_GetNewHandleEntry(%04x): %04x\n",
+    TRACE(local, "(%04x): %04x\n",
                    ds, ((char *)pEntry - ptr) );
     return (HLOCAL16)((char *)pEntry - ptr);
 }
@@ -996,7 +991,7 @@
     
     /* Remove the table from the linked list and free it */
 
-    dprintf_info(local, "LOCAL_FreeHandleEntry(%04x): freeing table %04x\n",
+    TRACE(local, "(%04x): freeing table %04x\n",
                    ds, table);
     *pTable = *(WORD *)pEntry;
     LOCAL_FreeArena( ds, ARENA_HEADER( table ) );
@@ -1012,7 +1007,7 @@
 {
     char *ptr = PTR_SEG_OFF_TO_LIN( ds, 0 );
 
-    dprintf_info(local, "LocalFree: %04x ds=%04x\n", handle, ds );
+    TRACE(local, "%04x ds=%04x\n", handle, ds );
     
     if (!handle) { fprintf( stderr, "LOCAL_Free: handle is 0.\n" ); return 0; }
     if (HANDLE_FIXED( handle ))
@@ -1025,7 +1020,7 @@
         LOCALHANDLEENTRY *pEntry = (LOCALHANDLEENTRY *)(ptr + handle);
         if (pEntry->flags != (LMEM_DISCARDED >> 8))
         {
-            dprintf_info(local, "LocalFree: real block at %04x\n",
+            TRACE(local, "real block at %04x\n",
 			   pEntry->addr );
             if (LOCAL_FreeArena( ds, ARENA_HEADER(pEntry->addr) ))
                 return handle; /* couldn't free it */
@@ -1047,7 +1042,7 @@
     char *ptr;
     HLOCAL16 handle;
     
-    dprintf_info(local, "LocalAlloc: %04x %d ds=%04x\n", flags, size, ds );
+    TRACE(local, "%04x %d ds=%04x\n", flags, size, ds );
 
     if(size > 0 && size <= 4) size = 5;
     if (flags & LMEM_MOVEABLE)
@@ -1114,7 +1109,7 @@
      ((LOCALHANDLEENTRY *)(ptr + handle))->lock == 0xff) /* An unused handle */
 	return 0;
 
-    dprintf_info(local, "LocalReAlloc: %04x %d %04x ds=%04x\n",
+    TRACE(local, "%04x %d %04x ds=%04x\n",
                    handle, size, flags, ds );
     if (!(pInfo = LOCAL_GetHeap( ds ))) return 0;
     
@@ -1129,7 +1124,7 @@
 	    if(pEntry->addr)
 		fprintf(stderr,
 			"LOCAL_ReAlloc: Dicarded block has non-zero addr.\n");
-	    dprintf_info(local, "ReAllocating discarded block\n");
+	    TRACE(local, "ReAllocating discarded block\n");
 	    if(size <= 4) size = 5;
 	    if (!(hl = LOCAL_GetBlock( ds, size + sizeof(HLOCAL16), flags)))
 		return 0;
@@ -1159,7 +1154,7 @@
 	{
 	    pEntry = (LOCALHANDLEENTRY *)(ptr + handle);
 	    pEntry->flags = (flags & 0x0f00) >> 8;
-	    dprintf_info(local, "Changing flags to %x.\n", pEntry->flags);
+	    TRACE(local, "Changing flags to %x.\n", pEntry->flags);
 	}
 	return handle;
     }
@@ -1170,7 +1165,7 @@
         {
 	    if (HANDLE_FIXED(handle))
 	    {
-                dprintf_info(local, "Freeing fixed block.\n");
+                TRACE(local, "Freeing fixed block.\n");
                 return LOCAL_Free( ds, handle );
             }
 	    else /* Moveable block */
@@ -1179,7 +1174,7 @@
 		if (pEntry->lock == 0)
 		{
 		    /* discards moveable blocks */
-                    dprintf_info(local,"Discarding block\n");
+                    TRACE(local,"Discarding block\n");
                     LOCAL_FreeArena(ds, ARENA_HEADER(pEntry->addr));
                     pEntry->addr = 0;
                     pEntry->flags = (LMEM_DISCARDED >> 8);
@@ -1201,7 +1196,7 @@
     }
 
     arena = ARENA_HEADER( blockhandle );
-    dprintf_info(local, "LocalReAlloc: arena is %04x\n", arena );
+    TRACE(local, "arena is %04x\n", arena );
     pArena = ARENA_PTR( ptr, arena );
 
     if(size <= 4) size = 5;
@@ -1212,9 +1207,9 @@
 
     if (nextarena <= pArena->next)
     {
-	dprintf_info(local, "size reduction, making new free block\n");
+	TRACE(local, "size reduction, making new free block\n");
 	LOCAL_ShrinkArena(ds, arena, nextarena - arena);
-        dprintf_info(local, "LocalReAlloc: returning %04x\n", handle );
+        TRACE(local, "returning %04x\n", handle );
         return handle;
     }
 
@@ -1224,9 +1219,9 @@
     if (((pNext->prev & 3) == LOCAL_ARENA_FREE) &&
         (nextarena <= pNext->next))
     {
-	dprintf_info(local, "size increase, making new free block\n");
+	TRACE(local, "size increase, making new free block\n");
         LOCAL_GrowArenaUpward(ds, arena, nextarena - arena);
-        dprintf_info(local, "LocalReAlloc: returning %04x\n", handle );
+        TRACE(local, "returning %04x\n", handle );
         return handle;
     }
 
@@ -1237,16 +1232,14 @@
     {
 	if (HANDLE_FIXED(handle))
         {
-            dprintf_warn(local,
-	     "Needed to move fixed block, but LMEM_MOVEABLE not specified.\n");
+            WARN(local, "Needed to move fixed block, but LMEM_MOVEABLE not specified.\n");
             return 0;
         }
 	else
 	{
 	    if(((LOCALHANDLEENTRY *)(ptr + handle))->lock != 0)
 	    {
-		dprintf_warn(local,
-	       "Needed to move locked block, but LMEM_MOVEABLE not specified.\n");
+		WARN(local, "Needed to move locked block, but LMEM_MOVEABLE not specified.\n");
 		return 0;
 	    }
         }
@@ -1282,7 +1275,7 @@
     }
     if (HANDLE_MOVEABLE( handle ))
     {
-	dprintf_info(local, "LocalReAlloc: fixing handle\n");
+	TRACE(local, "fixing handle\n");
         pEntry = (LOCALHANDLEENTRY *)(ptr + handle);
         pEntry->addr = hmem + sizeof(HLOCAL16);
 	/* Back ptr should still be correct */
@@ -1291,7 +1284,7 @@
 	hmem = handle;
     }
     if (size == oldsize) hmem = 0;  /* Realloc failed */
-    dprintf_info(local, "LocalReAlloc: returning %04x\n", hmem );
+    TRACE(local, "returning %04x\n", hmem );
     return hmem;
 }
 
@@ -1310,7 +1303,7 @@
         if (pEntry->lock < 0xfe) pEntry->lock++;
         handle = pEntry->addr;
     }
-    dprintf_info(local, "LocalLock: %04x returning %04x\n", 
+    TRACE(local, "%04x returning %04x\n", 
 		   old_handle, handle );
     return handle;
 }
@@ -1343,7 +1336,7 @@
 {
     char *ptr = PTR_SEG_OFF_TO_LIN( ds, 0 );
 
-    dprintf_info(local, "LocalUnlock: %04x\n", handle );
+    TRACE(local, "%04x\n", handle );
     if (HANDLE_MOVEABLE(handle))
     {
         LOCALHANDLEENTRY *pEntry = (LOCALHANDLEENTRY *)(ptr + handle);
@@ -1366,7 +1359,7 @@
     char *ptr = PTR_SEG_OFF_TO_LIN( CURRENT_DS, 0 );
     LOCALARENA *pArena;
 
-    dprintf_info(local, "LocalSize: %04x ds=%04x\n", handle, ds );
+    TRACE(local, "%04x ds=%04x\n", handle, ds );
 
     if (HANDLE_MOVEABLE( handle )) handle = *(WORD *)(ptr + handle);
     if (!handle) return 0;
@@ -1387,13 +1380,13 @@
     if (HANDLE_MOVEABLE(handle))
     {
         LOCALHANDLEENTRY *pEntry = (LOCALHANDLEENTRY *)(ptr + handle);
-        dprintf_info(local, "LOCAL_Flags(%04x,%04x): returning %04x\n",
+        TRACE(local, "(%04x,%04x): returning %04x\n",
                        ds, handle, pEntry->lock | (pEntry->flags << 8) );
         return pEntry->lock | (pEntry->flags << 8);
     }
     else
     {
-        dprintf_info(local, "LOCAL_Flags(%04x,%04x): returning 0\n",
+        TRACE(local, "(%04x,%04x): returning 0\n",
                        ds, handle );
         return 0;
     }
@@ -1442,7 +1435,7 @@
 	if (arena == pArena->free_next) break;
         total += pArena->size;
     }
-    dprintf_info(local, "LOCAL_CountFree(%04x): returning %d\n", ds, total);
+    TRACE(local, "(%04x): returning %d\n", ds, total);
     return total;
 }
 
@@ -1560,7 +1553,7 @@
  */
 UINT16 WINAPI LocalCompact16( UINT16 minfree )
 {
-    dprintf_info(local, "LocalCompact: %04x\n", minfree );
+    TRACE(local, "%04x\n", minfree );
     return LOCAL_Compact( CURRENT_DS, minfree, 0 );
 }
 
@@ -1580,7 +1573,7 @@
 	LOCAL_PrintHeap( ds );
 	return 0;
     }
-    dprintf_info(local, "LocalNotify(%04x): %08lx\n", ds, (DWORD)func );
+    TRACE(local, "(%04x): %08lx\n", ds, (DWORD)func );
     fprintf(stdnimp, "LocalNotify(): Half implemented\n");
     oldNotify = pInfo->notify;
     pInfo->notify = func;
@@ -1593,7 +1586,7 @@
  */
 UINT16 WINAPI LocalShrink16( HGLOBAL16 handle, UINT16 newsize )
 {
-    dprintf_info(local, "LocalShrink: %04x %04x\n", handle, newsize );
+    TRACE(local, "%04x %04x\n", handle, newsize );
     return 0;
 }
 
@@ -1626,7 +1619,7 @@
  */
 WORD WINAPI LocalHeapSize(void)
 {
-    dprintf_info(local, "LocalHeapSize:\n" );
+    TRACE(local, "(void)\n" );
     return LOCAL_HeapSize( CURRENT_DS );
 }
 
@@ -1645,7 +1638,7 @@
 	return 0;
     }
     if (delta) pInfo->hdelta = delta;
-    dprintf_info(local, "LocalHandleDelta: returning %04x\n", pInfo->hdelta);
+    TRACE(local, "returning %04x\n", pInfo->hdelta);
     return pInfo->hdelta;
 }
 
diff --git a/memory/selector.c b/memory/selector.c
index 9188f55..e277ea5 100644
--- a/memory/selector.c
+++ b/memory/selector.c
@@ -59,7 +59,7 @@
 
     count = sel ? ((GET_SEL_LIMIT(sel) >> 16) + 1) : 1;
     newsel = AllocSelectorArray( count );
-    dprintf_info(selector, "AllocSelector(%04x): returning %04x\n",
+    TRACE(selector, "(%04x): returning %04x\n",
                       sel, newsel );
     if (!newsel) return 0;
     if (!sel) return newsel;  /* nothing to copy */
@@ -148,7 +148,7 @@
     ldt_entry entry;
     STACK16FRAME *frame;
 
-    dprintf_info(selector, "SELECTOR_FreeBlock(%04x,%d)\n", sel, count );
+    TRACE(selector, "(%04x,%d)\n", sel, count );
     sel &= ~(__AHINCR - 1);  /* clear bottom bits of selector */
     nextsel = sel + (count << __AHSHIFT);
 
@@ -252,7 +252,7 @@
     ldt_entry entry;
 
     newsel = AllocSelectorArray( 1 );
-    dprintf_info(selector, "AllocCStoDSAlias(%04x): returning %04x\n",
+    TRACE(selector, "(%04x): returning %04x\n",
                       sel, newsel );
     if (!newsel) return 0;
     LDT_GetEntry( SELECTOR_TO_ENTRY(sel), &entry );
@@ -271,7 +271,7 @@
     ldt_entry entry;
 
     newsel = AllocSelectorArray( 1 );
-    dprintf_info(selector, "AllocDStoCSAlias(%04x): returning %04x\n",
+    TRACE(selector, "(%04x): returning %04x\n",
                       sel, newsel );
     if (!newsel) return 0;
     LDT_GetEntry( SELECTOR_TO_ENTRY(sel), &entry );
diff --git a/memory/string.c b/memory/string.c
index 8a4a18a..65e5709 100644
--- a/memory/string.c
+++ b/memory/string.c
@@ -77,7 +77,7 @@
  */
 LPSTR WINAPI lstrcat32A( LPSTR dst, LPCSTR src )
 {
-    dprintf_info(string,"strcat: Append %s to %s\n",
+    TRACE(string,"Append %s to %s\n",
 		   debugstr_a (src), debugstr_a (dst));
     /* Windows does not check for NULL pointers here, so we don't either */
     strcat( dst, src );
@@ -91,7 +91,7 @@
 LPWSTR WINAPI lstrcat32W( LPWSTR dst, LPCWSTR src )
 {
     register LPWSTR p = dst;
-    dprintf_info(string,"strcat: Append L%s to L%s\n",
+    TRACE(string,"Append L%s to L%s\n",
 		   debugstr_w (src), debugstr_w (dst));
     /* Windows does not check for NULL pointers here, so we don't either */
     while (*p) p++;
@@ -116,7 +116,7 @@
 LPSTR WINAPI lstrcatn32A( LPSTR dst, LPCSTR src, INT32 n )
 {
     register LPSTR p = dst;
-    dprintf_info(string,"strcatn add %d chars from %s to %s\n",
+    TRACE(string,"strcatn add %d chars from %s to %s\n",
 		   n, debugstr_an (src, n), debugstr_a (dst));
     while (*p) p++;
     if ((n -= (INT32)(p - dst)) <= 0) return dst;
@@ -131,7 +131,7 @@
 LPWSTR WINAPI lstrcatn32W( LPWSTR dst, LPCWSTR src, INT32 n )
 {
     register LPWSTR p = dst;
-    dprintf_info(string,"strcatn add %d chars from L%s to L%s\n",
+    TRACE(string,"strcatn add %d chars from L%s to L%s\n",
 		   n, debugstr_wn (src, n), debugstr_w (dst));
     while (*p) p++;
     if ((n -= (INT32)(p - dst)) <= 0) return dst;
@@ -154,7 +154,7 @@
  */
 INT32 WINAPI lstrcmp32A( LPCSTR str1, LPCSTR str2 )
 {
-    dprintf_info(string,"strcmp: %s and %s\n",
+    TRACE(string,"%s and %s\n",
 		   debugstr_a (str1), debugstr_a (str2));
     /* Win95 KERNEL32.DLL does it that way. Hands off! */
     if (!str1 || !str2) {
@@ -170,7 +170,7 @@
  */
 INT32 WINAPI lstrcmp32W( LPCWSTR str1, LPCWSTR str2 )
 {
-    dprintf_info(string,"strcmp: L%s and L%s\n",
+    TRACE(string,"L%s and L%s\n",
 		   debugstr_w (str1), debugstr_w (str2));
     if (!str1 || !str2) {
     	SetLastError(ERROR_INVALID_PARAMETER);
@@ -197,7 +197,7 @@
 {
     INT32 res;
 
-    dprintf_info(string,"strcmpi %s and %s\n",
+    TRACE(string,"strcmpi %s and %s\n",
 		   debugstr_a (str1), debugstr_a (str2));
     if (!str1 || !str2) {
     	SetLastError(ERROR_INVALID_PARAMETER);
@@ -222,7 +222,7 @@
 
 #if 0
     /* Too much!  (From registry loading.)  */
-    dprintf_info(string,"strcmpi L%s and L%s\n",
+    TRACE(string,"strcmpi L%s and L%s\n",
 		   debugstr_w (str1), debugstr_w (str2));
 #endif
     if (!str1 || !str2) {
@@ -255,7 +255,7 @@
  */
 LPSTR WINAPI lstrcpy32A( LPSTR dst, LPCSTR src )
 {
-    dprintf_info(string,"strcpy %s\n", debugstr_a (src));
+    TRACE(string,"strcpy %s\n", debugstr_a (src));
     /* Windows does not check for NULL pointers here, so we don't either */
     strcpy( dst, src );
     return dst;
@@ -268,7 +268,7 @@
 LPWSTR WINAPI lstrcpy32W( LPWSTR dst, LPCWSTR src )
 {
     register LPWSTR p = dst;
-    dprintf_info(string,"strcpy L%s\n", debugstr_w (src));
+    TRACE(string,"strcpy L%s\n", debugstr_w (src));
     /* Windows does not check for NULL pointers here, so we don't either */
     while ((*p++ = *src++));
     return dst;
@@ -287,11 +287,13 @@
 
 /***********************************************************************
  *           lstrcpyn32A   (KERNEL32.611)
+ * Note: this function differs from the UNIX strncpy, it _always_ writes
+ * a terminating \0
  */
 LPSTR WINAPI lstrcpyn32A( LPSTR dst, LPCSTR src, INT32 n )
 {
     LPSTR p = dst;
-    dprintf_info(string,"strcpyn %s for %d chars\n",
+    TRACE(string,"strcpyn %s for %d chars\n",
 		   debugstr_an (src,n), n);
     /* Windows does not check for NULL pointers here, so we don't either */
     while ((n-- > 1) && *src) *p++ = *src++;
@@ -302,11 +304,13 @@
 
 /***********************************************************************
  *           lstrcpyn32W   (KERNEL32.612)
+ * Note: this function differs from the UNIX strncpy, it _always_ writes
+ * a terminating \0
  */
 LPWSTR WINAPI lstrcpyn32W( LPWSTR dst, LPCWSTR src, INT32 n )
 {
     LPWSTR p = dst;
-    dprintf_info(string,"strcpyn L%s for %d chars\n",
+    TRACE(string,"strcpyn L%s for %d chars\n",
 		   debugstr_wn (src,n), n);
     /* Windows does not check for NULL pointers here, so we don't either */
     while ((n-- > 1) && *src) *p++ = *src++;
@@ -333,7 +337,7 @@
      * in lstrlen() ... we check only for NULL pointer reference.
      * - Marcus Meissner
      */
-    dprintf_info(string,"strlen %s\n", debugstr_a (str));
+    TRACE(string,"strlen %s\n", debugstr_a (str));
     if (!str) return 0;
     return (INT32)strlen(str);
 }
@@ -345,7 +349,7 @@
 INT32 WINAPI lstrlen32W( LPCWSTR str )
 {
     INT32 len = 0;
-    dprintf_info(string,"strlen L%s\n", debugstr_w (str));
+    TRACE(string,"strlen L%s\n", debugstr_w (str));
     if (!str) return 0;
     while (*str++) len++;
     return len;
@@ -357,7 +361,7 @@
  */
 INT32 WINAPI lstrncmp32A( LPCSTR str1, LPCSTR str2, INT32 n )
 {
-    dprintf_info(string,"strncmp %s and %s for %d chars\n",
+    TRACE(string,"strncmp %s and %s for %d chars\n",
 		   debugstr_an (str1, n), debugstr_an (str2, n), n);
     return (INT32)strncmp( str1, str2, n );
 }
@@ -368,7 +372,7 @@
  */
 INT32 WINAPI lstrncmp32W( LPCWSTR str1, LPCWSTR str2, INT32 n )
 {
-    dprintf_info(string,"strncmp L%s and L%s for %d chars\n",
+    TRACE(string,"strncmp L%s and L%s for %d chars\n",
 		   debugstr_wn (str1, n), debugstr_wn (str2, n), n);
     if (!n) return 0;
     while ((--n > 0) && *str1 && (*str1 == *str2)) { str1++; str2++; }
@@ -383,7 +387,7 @@
 {
     INT32 res;
 
-    dprintf_info(string,"strncmpi %s and %s for %d chars\n",
+    TRACE(string,"strncmpi %s and %s for %d chars\n",
 		   debugstr_an (str1, n), debugstr_an (str2, n), n);
     if (!n) return 0;
     while ((--n > 0) && *str1)
@@ -400,7 +404,7 @@
 {
     INT32 res;
 
-    dprintf_info(string,"strncmpi L%s and L%s for %d chars\n",
+    TRACE(string,"strncmpi L%s and L%s for %d chars\n",
 		   debugstr_wn (str1, n), debugstr_wn (str2, n), n);
     if (!n) return 0;
     while ((--n > 0) && *str1)
@@ -438,6 +442,8 @@
 
 /***********************************************************************
  *           lstrcpynAtoW   (Not a Windows API)
+ * Note: this function differs from the UNIX strncpy, it _always_ writes
+ * a terminating \0
  */
 LPWSTR WINAPI lstrcpynAtoW( LPWSTR dst, LPCSTR src, INT32 n )
 {
@@ -450,6 +456,8 @@
 
 /***********************************************************************
  *           lstrcpynWtoA   (Not a Windows API)
+ * Note: this function differs from the UNIX strncpy, it _always_ writes
+ * a terminating \0
  */
 LPSTR WINAPI lstrcpynWtoA( LPSTR dst, LPCWSTR src, INT32 n )
 {
@@ -541,9 +549,9 @@
 {
     LPSTR oldd = d;
     if (!s || !d) return TRUE;
-    dprintf_info(string,"CharToOem %s\n", debugstr_a (s));
+    TRACE(string,"CharToOem %s\n", debugstr_a (s));
     while ((*d++ = ANSI_TO_OEM(*s++)));
-    dprintf_info(string,"       to %s\n", debugstr_a (oldd));
+    TRACE(string,"       to %s\n", debugstr_a (oldd));
     return TRUE;
 }
 
@@ -575,9 +583,9 @@
 {
     LPSTR oldd = d;
     if (!s || !d) return TRUE;
-    dprintf_info(string,"CharToOem L%s\n", debugstr_w (s));
+    TRACE(string,"CharToOem L%s\n", debugstr_w (s));
     while ((*d++ = ANSI_TO_OEM(*s++)));
-    dprintf_info(string,"       to %s\n", debugstr_a (oldd));
+    TRACE(string,"       to %s\n", debugstr_a (oldd));
     return TRUE;
 }
 
@@ -588,9 +596,9 @@
 BOOL32 WINAPI OemToChar32A( LPCSTR s, LPSTR d )
 {
     LPSTR oldd = d;
-    dprintf_info(string,"OemToChar %s\n", debugstr_a (s));
+    TRACE(string,"OemToChar %s\n", debugstr_a (s));
     while ((*d++ = OEM_TO_ANSI(*s++)));
-    dprintf_info(string,"       to %s\n", debugstr_a (oldd));
+    TRACE(string,"       to %s\n", debugstr_a (oldd));
     return TRUE;
 }
 
@@ -600,7 +608,7 @@
  */
 BOOL32 WINAPI OemToCharBuff32A( LPCSTR s, LPSTR d, DWORD len )
 {
-    dprintf_info(string,"OemToCharBuff %s\n", debugstr_an (s, len));
+    TRACE(string,"OemToCharBuff %s\n", debugstr_an (s, len));
     while (len--) *d++ = OEM_TO_ANSI(*s++);
     return TRUE;
 }
@@ -611,7 +619,7 @@
  */
 BOOL32 WINAPI OemToCharBuff32W( LPCSTR s, LPWSTR d, DWORD len )
 {
-    dprintf_info(string,"OemToCharBuff %s\n", debugstr_an (s, len));
+    TRACE(string,"OemToCharBuff %s\n", debugstr_an (s, len));
     while (len--) *d++ = (WCHAR)OEM_TO_ANSI(*s++);
     return TRUE;
 }
diff --git a/memory/virtual.c b/memory/virtual.c
index 0ee4f21..937e482 100644
--- a/memory/virtual.c
+++ b/memory/virtual.c
@@ -109,7 +109,7 @@
 };
 
 #define VIRTUAL_DEBUG_DUMP_VIEW(view) \
-   if (!debugging_info(virtual)); else VIRTUAL_DumpView(view)
+   if (!TRACE_ON(virtual)); else VIRTUAL_DumpView(view)
 
 /***********************************************************************
  *           VIRTUAL_GetProtStr
@@ -345,7 +345,7 @@
 static BOOL32 VIRTUAL_SetProt( FILE_VIEW *view, UINT32 base,
                                UINT32 size, BYTE vprot )
 {
-    dprintf_info(virtual, "VIRTUAL_SetProt: %08x-%08x %s\n",
+    TRACE(virtual, "%08x-%08x %s\n",
                      base, base + size - 1, VIRTUAL_GetProtStr( vprot ) );
 
     if (mprotect( (void *)base, size, VIRTUAL_GetUnixProt(vprot) ))
@@ -437,14 +437,23 @@
 
 /***********************************************************************
  *             VirtualAlloc   (KERNEL32.548)
+ * Reserves or commits a region of pages in virtual address space
+ *
+ * RETURNS
+ *	Base address of allocated region of pages
+ *	NULL: Failure
  */
-LPVOID WINAPI VirtualAlloc( LPVOID addr, DWORD size, DWORD type, DWORD protect)
-{
+LPVOID WINAPI VirtualAlloc(
+              LPVOID addr,  /* Address of region to reserve or commit */
+              DWORD size,   /* Size of region */
+              DWORD type,   /* Type of allocation */
+              DWORD protect /* Type of access protection */
+) {
     FILE_VIEW *view;
     UINT32 base, ptr, view_size;
     BYTE vprot;
 
-    dprintf_info(virtual, "VirtualAlloc: %08x %08lx %lx %08lx\n",
+    TRACE(virtual, "%08x %08lx %lx %08lx\n",
                      (UINT32)addr, size, type, protect );
 
     /* Round parameters to a page boundary */
@@ -552,13 +561,21 @@
 
 /***********************************************************************
  *             VirtualFree   (KERNEL32.550)
+ * Release or decommits a region of pages in virtual address space.
+ * 
+ * RETURNS
+ *	TRUE: Success
+ *	FALSE: Failure
  */
-BOOL32 WINAPI VirtualFree( LPVOID addr, DWORD size, DWORD type )
-{
+BOOL32 WINAPI VirtualFree(
+              LPVOID addr, /* Address of region of committed pages */
+              DWORD size,  /* Size of region */
+              DWORD type   /* Type of operation */
+) {
     FILE_VIEW *view;
     UINT32 base;
 
-    dprintf_info(virtual, "VirtualFree: %08x %08lx %lx\n",
+    TRACE(virtual, "%08x %08lx %lx\n",
                      (UINT32)addr, size, type );
 
     /* Fix the parameters */
@@ -602,33 +619,61 @@
 
 /***********************************************************************
  *             VirtualLock   (KERNEL32.551)
+ * Locks the specified region of virtual address space
+ * 
+ * NOTE
+ *	Always returns TRUE
+ *
+ * RETURNS
+ *	TRUE: Success
+ *	FALSE: Failure
  */
-BOOL32 WINAPI VirtualLock( LPVOID addr, DWORD size )
-{
+BOOL32 WINAPI VirtualLock(
+              LPVOID addr, /* Address of first byte of range to lock */
+              DWORD size   /* Number of bytes in range to lock */
+) {
     return TRUE;
 }
 
 
 /***********************************************************************
  *             VirtualUnlock   (KERNEL32.556)
+ * Unlocks a range of pages in the virtual address space
+ *
+ * NOTE
+ *	Always returns TRUE
+ *
+ * RETURNS
+ *	TRUE: Success
+ *	FALSE: Failure
  */
-BOOL32 WINAPI VirtualUnlock( LPVOID addr, DWORD size )
-{
+BOOL32 WINAPI VirtualUnlock(
+              LPVOID addr, /* Address of first byte of range */
+              DWORD size   /* Number of bytes in range */
+) {
     return TRUE;
 }
 
 
 /***********************************************************************
  *             VirtualProtect   (KERNEL32.552)
+ * Changes the access protection on a region of committed pages
+ *
+ * RETURNS
+ *	TRUE: Success
+ *	FALSE: Failure
  */
-BOOL32 WINAPI VirtualProtect( LPVOID addr, DWORD size, DWORD new_prot,
-                              LPDWORD old_prot )
-{
+BOOL32 WINAPI VirtualProtect(
+              LPVOID addr,     /* Address of region of committed pages */
+              DWORD size,      /* Size of region */
+              DWORD new_prot,  /* Desired access protection */
+              LPDWORD old_prot /* Address of variable to get old protection */
+) {
     FILE_VIEW *view;
     UINT32 base, i;
     BYTE vprot, *p;
 
-    dprintf_info(virtual, "VirtualProtect: %08x %08lx %08lx\n",
+    TRACE(virtual, "%08x %08lx %08lx\n",
                      (UINT32)addr, size, new_prot );
 
     /* Fix the parameters */
@@ -663,10 +708,20 @@
 
 /***********************************************************************
  *             VirtualProtectEx   (KERNEL32.553)
+ * Changes the access protection on a region of committed pages in the
+ * virtual address space of a specified process
+ *
+ * RETURNS
+ *	TRUE: Success
+ *	FALSE: Failure
  */
-BOOL32 WINAPI VirtualProtectEx( HANDLE32 handle, LPVOID addr, DWORD size,
-                                DWORD new_prot, LPDWORD old_prot )
-{
+BOOL32 WINAPI VirtualProtectEx(
+              HANDLE32 handle, /* Handle of process */
+              LPVOID addr,     /* Address of region of committed pages */
+              DWORD size,      /* Size of region */
+              DWORD new_prot,  /* Desired access protection */
+	      LPDWORD old_prot /* Address of variable to get old protection */
+) {
     BOOL32 ret = FALSE;
 
     PDB32 *pdb = PROCESS_GetPtr( handle, PROCESS_VM_OPERATION );
@@ -684,10 +739,16 @@
 
 /***********************************************************************
  *             VirtualQuery   (KERNEL32.554)
+ * Provides info about a range of pages in virtual address space
+ *
+ * RETURNS
+ *	Number of bytes returned in information buffer
  */
-BOOL32 WINAPI VirtualQuery( LPCVOID addr, LPMEMORY_BASIC_INFORMATION info,
-                            DWORD len )
-{
+DWORD WINAPI VirtualQuery(
+             LPCVOID addr, /* Address of region */
+             LPMEMORY_BASIC_INFORMATION info, /* Address of info buffer */
+             DWORD len     /* Size of buffer */
+) {
     FILE_VIEW *view = VIRTUAL_FirstView;
     UINT32 base = ROUND_ADDR( addr );
     UINT32 alloc_base = 0;
@@ -740,17 +801,25 @@
     info->BaseAddress    = (LPVOID)base;
     info->AllocationBase = (LPVOID)alloc_base;
     info->RegionSize     = size - (base - alloc_base);
-    return TRUE;
+    return sizeof(*info);
 }
 
 
 /***********************************************************************
  *             VirtualQueryEx   (KERNEL32.555)
+ * Provides info about a range of pages in virtual address space of a
+ * specified process
+ *
+ * RETURNS
+ *	Number of bytes returned in information buffer
  */
-BOOL32 WINAPI VirtualQueryEx( HANDLE32 handle, LPCVOID addr,
-                              LPMEMORY_BASIC_INFORMATION info, DWORD len )
-{
-    BOOL32 ret = FALSE;
+DWORD WINAPI VirtualQueryEx(
+             HANDLE32 handle, /* Handle of process */
+             LPCVOID addr,    /* Address of region */
+             LPMEMORY_BASIC_INFORMATION info, /* Address of info buffer */
+             DWORD len        /* Size of buffer */
+) {
+    DWORD ret = len;
 
     PDB32 *pdb = PROCESS_GetPtr( handle, PROCESS_QUERY_INFORMATION );
     if (pdb)
@@ -767,9 +836,15 @@
 
 /***********************************************************************
  *             IsBadReadPtr32   (KERNEL32.354)
+ *
+ * RETURNS
+ *	FALSE: Process has read access to entire block
+ *      TRUE: Otherwise
  */
-BOOL32 WINAPI IsBadReadPtr32( LPCVOID ptr, UINT32 size )
-{
+BOOL32 WINAPI IsBadReadPtr32(
+              LPCVOID ptr, /* Address of memory block */
+              UINT32 size  /* Size of block */
+) {
     return !VIRTUAL_CheckFlags( (UINT32)ptr, size,
                                 VPROT_READ | VPROT_COMMITTED );
 }
@@ -777,9 +852,15 @@
 
 /***********************************************************************
  *             IsBadWritePtr32   (KERNEL32.357)
+ *
+ * RETURNS
+ *	FALSE: Process has write access to entire block
+ *      TRUE: Otherwise
  */
-BOOL32 WINAPI IsBadWritePtr32( LPVOID ptr, UINT32 size )
-{
+BOOL32 WINAPI IsBadWritePtr32(
+	      LPVOID ptr, /* address of memory block */
+	      UINT32 size /* size of block */
+) {
     return !VIRTUAL_CheckFlags( (UINT32)ptr, size,
                                 VPROT_WRITE | VPROT_COMMITTED );
 }
@@ -814,9 +895,15 @@
 
 /***********************************************************************
  *             IsBadStringPtr32A   (KERNEL32.355)
+ *
+ * RETURNS
+ *	FALSE: Read access to all bytes in string
+ *	TRUE: Else
  */
-BOOL32 WINAPI IsBadStringPtr32A( LPCSTR str, UINT32 max )
-{
+BOOL32 WINAPI IsBadStringPtr32A(
+              LPCSTR str, /* Address of string */
+              UINT32 max  /* Maximum size of string */
+) {
     FILE_VIEW *view;
     UINT32 page, count;
 
@@ -842,9 +929,15 @@
 
 /***********************************************************************
  *             IsBadStringPtr32W   (KERNEL32.356)
+ *
+ * RETURNS
+ *	FALSE: Read access to all bytes in string
+ *	TRUE: Else
  */
-BOOL32 WINAPI IsBadStringPtr32W( LPCWSTR str, UINT32 max )
-{
+BOOL32 WINAPI IsBadStringPtr32W(
+              LPCWSTR str, /* Address of string */
+              UINT32 max   /* Maximum size of string */
+) {
     FILE_VIEW *view;
     UINT32 page, count;
 
@@ -870,11 +963,21 @@
 
 /***********************************************************************
  *             CreateFileMapping32A   (KERNEL32.46)
+ * Creates a named or unnamed file-mapping object for the specified file
+ *
+ * RETURNS
+ *	Handle of the file-mapping object
+ *	0: Mapping object did not exist
+ *	NULL: Failure
  */
-HANDLE32 WINAPI CreateFileMapping32A(HFILE32 hFile, LPSECURITY_ATTRIBUTES attr,
-                                     DWORD protect, DWORD size_high,
-                                     DWORD size_low, LPCSTR name )
-{
+HANDLE32 WINAPI CreateFileMapping32A(
+                HFILE32 hFile,   /* Handle of file to map */
+                LPSECURITY_ATTRIBUTES attr, /* Optional security attributes */
+                DWORD protect,   /* Protection for mapping object */
+                DWORD size_high, /* High-order 32 bits of object size */
+                DWORD size_low,  /* Low-order 32 bits of object size */
+                LPCSTR name      /* Name of file-mapping object */
+) {
     FILE_MAPPING *mapping = NULL;
     HANDLE32 handle;
     BYTE vprot;
@@ -900,7 +1003,7 @@
 
     /* Check parameters */
 
-    dprintf_info(virtual,"CreateFileMapping32A(%x,%p,%08lx,%08lx%08lx,%s)\n",
+    TRACE(virtual,"(%x,%p,%08lx,%08lx%08lx,%s)\n",
                     hFile, attr, protect, size_high, size_low, name );
 
     vprot = VIRTUAL_GetProt( protect );
@@ -996,9 +1099,17 @@
 
 /***********************************************************************
  *             OpenFileMapping32A   (KERNEL32.397)
+ * Opens a named file-mapping object
+ *
+ * RETURNS
+ *	Open handle to specified file-mapping object
+ *	NULL: Failure
  */
-HANDLE32 WINAPI OpenFileMapping32A( DWORD access, BOOL32 inherit, LPCSTR name )
-{
+HANDLE32 WINAPI OpenFileMapping32A(
+                DWORD access,   /* Access mode */
+                BOOL32 inherit, /* Inherit flag */
+                LPCSTR name     /* Name of file-mapping object */
+) {
     HANDLE32 handle = 0;
     K32OBJ *obj;
     SYSTEM_LOCK();
@@ -1042,10 +1153,19 @@
 
 /***********************************************************************
  *             MapViewOfFile   (KERNEL32.385)
+ * Maps a view of a file into the address space
+ *
+ * RETURNS
+ *	Starting address of mapped view
+ *	NULL: Failure
  */
-LPVOID WINAPI MapViewOfFile( HANDLE32 mapping, DWORD access, DWORD offset_high,
-                             DWORD offset_low, DWORD count )
-{
+LPVOID WINAPI MapViewOfFile(
+              HANDLE32 mapping,  /* File-mapping object to map */
+              DWORD access,      /* Access mode */
+              DWORD offset_high, /* High-order 32 bits of file offset */
+              DWORD offset_low,  /* Low-order 32 bits of file offset */
+              DWORD count        /* Number of bytes to map */
+) {
     return MapViewOfFileEx( mapping, access, offset_high,
                             offset_low, count, NULL );
 }
@@ -1053,10 +1173,20 @@
 
 /***********************************************************************
  *             MapViewOfFileEx   (KERNEL32.386)
+ * Maps a view of a file into the address space
+ *
+ * RETURNS
+ *	Starting address of mapped view
+ *	NULL: Failure
  */
-LPVOID WINAPI MapViewOfFileEx(HANDLE32 handle, DWORD access, DWORD offset_high,
-                              DWORD offset_low, DWORD count, LPVOID addr )
-{
+LPVOID WINAPI MapViewOfFileEx(
+              HANDLE32 handle,   /* File-mapping object to map */
+              DWORD access,      /* Access mode */
+              DWORD offset_high, /* High-order 32 bits of file offset */
+              DWORD offset_low,  /* Low-order 32 bits of file offset */
+              DWORD count,       /* Number of bytes to map */
+              LPVOID addr        /* Suggested starting address for mapped view */
+) {
     FILE_MAPPING *mapping;
     FILE_VIEW *view;
     UINT32 ptr = (UINT32)-1, size = 0;
@@ -1112,7 +1242,7 @@
 
     /* Map the file */
 
-    dprintf_info(virtual, "MapViewOfFile: handle=%x size=%x offset=%lx\n",
+    TRACE(virtual, "handle=%x size=%x offset=%lx\n",
                      handle, size, offset_low );
 
     ptr = (UINT32)FILE_dommap( mapping->file, addr, 0, size, 0, offset_low,
@@ -1141,13 +1271,20 @@
 
 /***********************************************************************
  *             FlushViewOfFile   (KERNEL32.262)
+ * Writes to the disk a byte range within a mapped view of a file
+ *
+ * RETURNS
+ *	TRUE: Success
+ *	FALSE: Failure
  */
-BOOL32 WINAPI FlushViewOfFile( LPCVOID base, DWORD cbFlush )
-{
+BOOL32 WINAPI FlushViewOfFile(
+              LPCVOID base, /* Start address of byte range to flush */
+              DWORD cbFlush /* Number of bytes in range */
+) {
     FILE_VIEW *view;
     UINT32 addr = ROUND_ADDR( base );
 
-    dprintf_info(virtual, "FlushViewOfFile at %p for %ld bytes\n",
+    TRACE(virtual, "FlushViewOfFile at %p for %ld bytes\n",
                      base, cbFlush );
 
     if (!(view = VIRTUAL_FindView( addr )))
@@ -1159,8 +1296,8 @@
     if (!msync( (void *)addr, cbFlush, MS_SYNC )) return TRUE;
     SetLastError( ERROR_INVALID_PARAMETER );
     return FALSE;
-
 }
+
 /***********************************************************************
  *             UnmapViewOfFile   (KERNEL32.540)
  */
diff --git a/misc/Makefile.in b/misc/Makefile.in
index f9722db..319264c 100644
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -15,6 +15,7 @@
 	ddeml.c \
 	debugstr.c \
 	error.c \
+	imagelist.c \
 	lstr.c \
 	lzexpand.c \
 	main.c \
diff --git a/misc/aspi.c b/misc/aspi.c
index 363c424..8be4540 100644
--- a/misc/aspi.c
+++ b/misc/aspi.c
@@ -122,16 +122,16 @@
     sprintf(idstr, "scsi c%1dt%1dd%1d", prb->SRB_HaId, prb->SRB_Target, prb->SRB_Lun);
 
     if (!PROFILE_GetWineIniString(idstr, "Device", "", device_str, sizeof(device_str))) {
-	dprintf_info(aspi, "Trying to open unlisted scsi device %s\n", idstr);
+	TRACE(aspi, "Trying to open unlisted scsi device %s\n", idstr);
 	return -1;
     }
 
-    dprintf_info(aspi, "Opening device %s=%s\n", idstr, device_str);
+    TRACE(aspi, "Opening device %s=%s\n", idstr, device_str);
 
     fd = open(device_str, O_RDWR);
     if (fd == -1) {
 	int save_error = errno;
-	dprintf_warn(aspi, "Error opening device errno=%d\n", save_error);
+	WARN(aspi, "Error opening device errno=%d\n", save_error);
 	return -1;
     }
 
@@ -162,52 +162,52 @@
 
   switch (prb->CDBByte[0]) {
   case CMD_INQUIRY:
-    dprintf_info(aspi, "{\n");
-    dprintf_info(aspi, "\tEVPD: %d\n", prb->CDBByte[1] & 1);
-    dprintf_info(aspi, "\tLUN: %d\n", (prb->CDBByte[1] & 0xc) >> 1);
-    dprintf_info(aspi, "\tPAGE CODE: %d\n", prb->CDBByte[2]);
-    dprintf_info(aspi, "\tALLOCATION LENGTH: %d\n", prb->CDBByte[4]);
-    dprintf_info(aspi, "\tCONTROL: %d\n", prb->CDBByte[5]);
-    dprintf_info(aspi, "}\n");
+    TRACE(aspi, "{\n");
+    TRACE(aspi, "\tEVPD: %d\n", prb->CDBByte[1] & 1);
+    TRACE(aspi, "\tLUN: %d\n", (prb->CDBByte[1] & 0xc) >> 1);
+    TRACE(aspi, "\tPAGE CODE: %d\n", prb->CDBByte[2]);
+    TRACE(aspi, "\tALLOCATION LENGTH: %d\n", prb->CDBByte[4]);
+    TRACE(aspi, "\tCONTROL: %d\n", prb->CDBByte[5]);
+    TRACE(aspi, "}\n");
     break;
   case CMD_SCAN_SCAN:
-    dprintf_info(aspi, "Transfer Length: %d\n", prb->CDBByte[4]);
+    TRACE(aspi, "Transfer Length: %d\n", prb->CDBByte[4]);
     break;
   }
 
-  dprintf_info(aspi, "Host Adapter: %d\n", prb->SRB_HaId);
-  dprintf_info(aspi, "Flags: %d\n", prb->SRB_Flags);
+  TRACE(aspi, "Host Adapter: %d\n", prb->SRB_HaId);
+  TRACE(aspi, "Flags: %d\n", prb->SRB_Flags);
   if (TARGET_TO_HOST(prb)) {
-    dprintf_info(aspi, "\tData transfer: Target to host. Length checked.\n");
+    TRACE(aspi, "\tData transfer: Target to host. Length checked.\n");
   }
   else if (HOST_TO_TARGET(prb)) {
-    dprintf_info(aspi, "\tData transfer: Host to target. Length checked.\n");
+    TRACE(aspi, "\tData transfer: Host to target. Length checked.\n");
   }
   else if (NO_DATA_TRANSFERED(prb)) {
-    dprintf_info(aspi, "\tData transfer: none\n");
+    TRACE(aspi, "\tData transfer: none\n");
   }
   else {
-    dprintf_warn(aspi, "\tTransfer by scsi cmd. Length not checked\n");
+    WARN(aspi, "\tTransfer by scsi cmd. Length not checked\n");
   }
 
-  dprintf_info(aspi, "\tResidual byte length reporting %s\n", prb->SRB_Flags & 0x4 ? "enabled" : "disabled");
-  dprintf_info(aspi, "\tLinking %s\n", prb->SRB_Flags & 0x2 ? "enabled" : "disabled");
-  dprintf_info(aspi, "\tPosting %s\n", prb->SRB_Flags & 0x1 ? "enabled" : "disabled");
-  dprintf_info(aspi, "Target: %d\n", prb->SRB_Target);
-  dprintf_info(aspi, "Lun: %d\n", prb->SRB_Lun);
-  dprintf_info(aspi, "BufLen: %ld\n", prb->SRB_BufLen);
-  dprintf_info(aspi, "SenseLen: %d\n", prb->SRB_SenseLen);
-  dprintf_info(aspi, "BufPtr: %lx (%p)\n", prb->SRB_BufPointer, lpBuf);
-  dprintf_info(aspi, "LinkPointer %lx\n", prb->SRB_Rsvd1);
-  dprintf_info(aspi, "CDB Length: %d\n", prb->SRB_CDBLen);
-  dprintf_info(aspi, "POST Proc: %lx\n", (DWORD) prb->SRB_PostProc);
+  TRACE(aspi, "\tResidual byte length reporting %s\n", prb->SRB_Flags & 0x4 ? "enabled" : "disabled");
+  TRACE(aspi, "\tLinking %s\n", prb->SRB_Flags & 0x2 ? "enabled" : "disabled");
+  TRACE(aspi, "\tPosting %s\n", prb->SRB_Flags & 0x1 ? "enabled" : "disabled");
+  TRACE(aspi, "Target: %d\n", prb->SRB_Target);
+  TRACE(aspi, "Lun: %d\n", prb->SRB_Lun);
+  TRACE(aspi, "BufLen: %ld\n", prb->SRB_BufLen);
+  TRACE(aspi, "SenseLen: %d\n", prb->SRB_SenseLen);
+  TRACE(aspi, "BufPtr: %lx (%p)\n", prb->SRB_BufPointer, lpBuf);
+  TRACE(aspi, "LinkPointer %lx\n", prb->SRB_Rsvd1);
+  TRACE(aspi, "CDB Length: %d\n", prb->SRB_CDBLen);
+  TRACE(aspi, "POST Proc: %lx\n", (DWORD) prb->SRB_PostProc);
   cdb = &prb->CDBByte[0];
   cmd = prb->CDBByte[0];
   for (i = 0; i < prb->SRB_CDBLen; i++) {
     if (i != 0) dsprintf(aspi, ",");
     dsprintf(aspi, "%02x", *cdb++);
   }
-  dprintf_info(aspi, "CDB buffer[%s]\n", dbg_str(aspi));
+  TRACE(aspi, "CDB buffer[%s]\n", dbg_str(aspi));
 }
 
 static void
@@ -222,7 +222,7 @@
     if (i) dsprintf(aspi, ",");
     dsprintf(aspi, "%02x", *cdb++);
   }
-  dprintf_info(aspi, "SenseArea[%s]\n", dbg_str(aspi));
+  TRACE(aspi, "SenseArea[%s]\n", dbg_str(aspi));
 }
 
 static void
@@ -234,7 +234,7 @@
 
   switch (prb->CDBByte[0]) {
   case CMD_INQUIRY:
-    dprintf_info(aspi, "Vendor: %s\n", lpBuf + INQUIRY_VENDOR);
+    TRACE(aspi, "Vendor: %s\n", lpBuf + INQUIRY_VENDOR);
     break;
   case CMD_TEST_UNIT_READY:
     PrintSenseArea16(prb);
@@ -312,20 +312,20 @@
 	if (myerror == ENOMEM) {
 	    fprintf(stderr, "ASPI: Linux generic scsi driver\n  You probably need to re-compile your kernel with a larger SG_BIG_BUFF value (sg.h)\n  Suggest 130560\n");
 	}
-	dprintf_warn(aspi, "errno: = %d\n", myerror);
+	WARN(aspi, "errno: = %d\n", myerror);
     }
     goto error_exit;
   }
 
   status = read(fd, sg_reply_hdr, out_len);
   if (status < 0 || status != out_len) {
-    dprintf_warn(aspi, "not enough bytes read from scsi device%d\n", status);
+    WARN(aspi, "not enough bytes read from scsi device%d\n", status);
     goto error_exit;
   }
 
   if (sg_reply_hdr->result != 0) {
     error_code = sg_reply_hdr->result;
-    dprintf_warn(aspi, "reply header error (%d)\n", sg_reply_hdr->result);
+    WARN(aspi, "reply header error (%d)\n", sg_reply_hdr->result);
     goto error_exit;
   }
 
@@ -349,7 +349,7 @@
   /* now do  posting */
 
   if (ASPI_POSTING(prb) && prb->SRB_PostProc) {
-    dprintf_info(aspi, "ASPI: Post Routine (%lx) called\n", (DWORD) prb->SRB_PostProc);
+    TRACE(aspi, "Post Routine (%lx) called\n", (DWORD) prb->SRB_PostProc);
     Callbacks->CallASPIPostProc(prb->SRB_PostProc, segptr_prb);
   }
 
@@ -361,17 +361,17 @@
 error_exit:
   if (error_code == EBUSY) {
       prb->SRB_Status = SS_ASPI_IS_BUSY;
-      dprintf_info(aspi, "ASPI: Device busy\n");
+      TRACE(aspi, "Device busy\n");
   }
   else {
-      dprintf_warn(aspi, "ASPI_GenericHandleScsiCmd failed\n");
+      WARN(aspi, "ASPI_GenericHandleScsiCmd failed\n");
       prb->SRB_Status = SS_ERR;
   }
 
   /* I'm not sure exactly error codes work here
    * We probably should set prb->SRB_TargStat, SRB_HaStat ?
    */
-  dprintf_warn(aspi, "ASPI_GenericHandleScsiCmd: error_exit\n");
+  WARN(aspi, "ASPI_GenericHandleScsiCmd: error_exit\n");
   free(sg_reply_hdr);
   free(sg_hd);
   return prb->SRB_Status;
@@ -385,7 +385,7 @@
 WORD WINAPI GetASPISupportInfo16()
 {
 #ifdef linux
-    dprintf_info(aspi, "GETASPISupportInfo\n");
+    TRACE(aspi, "GETASPISupportInfo\n");
     /* high byte SS_COMP - low byte number of host adapters.
      * FIXME!!! The number of host adapters is incorrect.
      * I'm not sure how to determine this under linux etc.
@@ -407,19 +407,19 @@
 
   switch (lpSRB->common.SRB_cmd) {
   case SC_HA_INQUIRY:
-    dprintf_fixme(aspi, "ASPI: Not implemented SC_HA_INQUIRY\n");
+    FIXME(aspi, "Not implemented SC_HA_INQUIRY\n");
     break;
   case SC_GET_DEV_TYPE:
-    dprintf_fixme(aspi, "ASPI: Not implemented SC_GET_DEV_TYPE\n");
+    FIXME(aspi, "Not implemented SC_GET_DEV_TYPE\n");
     break;
   case SC_EXEC_SCSI_CMD:
     return ASPI_ExecScsiCmd16(&lpSRB->cmd, segptr_srb);
     break;
   case SC_RESET_DEV:
-    dprintf_fixme(aspi, "ASPI: Not implemented SC_RESET_DEV\n");
+    FIXME(aspi, "Not implemented SC_RESET_DEV\n");
     break;
   default:
-    dprintf_warn(aspi, "ASPI: Unknown command %d\n", lpSRB->common.SRB_cmd);
+    WARN(aspi, "Unknown command %d\n", lpSRB->common.SRB_cmd);
   }
   return SS_INVALID_SRB;
 #else
diff --git a/misc/comm.c b/misc/comm.c
index d418994..1fb36c7 100644
--- a/misc/comm.c
+++ b/misc/comm.c
@@ -83,8 +83,7 @@
 					COM[x].fd = 0;
 					strcpy(COM[x].devicename, temp);
 				}
-                dprintf_info(comm,
-                        "Comm_Init: %s = %s\n", option, COM[x].devicename);
+                TRACE(comm, "%s = %s\n", option, COM[x].devicename);
  		}
 
 		strcpy(option, "LPTx");
@@ -106,8 +105,7 @@
 					LPT[x].fd = 0;
 					strcpy(LPT[x].devicename, temp);
 				}
-                dprintf_info(comm,
-                        "Comm_Init: %s = %s\n", option, LPT[x].devicename);
+                TRACE(comm, "%s = %s\n", option, LPT[x].devicename);
 		}
 
 	}
@@ -152,7 +150,7 @@
 
 int WinError(void)
 {
-        dprintf_info(comm, "WinError: errno = %d\n", errno);
+        TRACE(comm, "errno = %d\n", errno);
 	switch (errno) {
 		default:
 			return CE_IOE;
@@ -169,8 +167,7 @@
 	int port;
 	char *ptr, temp[256];
 
-	dprintf_info(comm,
-		"BuildCommDCB: (%s), ptr %p\n", device, lpdcb);
+	TRACE(comm, "(%s), ptr %p\n", device, lpdcb);
 	commerror = 0;
 
 	if (!lstrncmpi32A(device,"COM",3)) {
@@ -207,13 +204,13 @@
 			lpdcb->BaudRate = COM[port].baudrate;
 		else
 			lpdcb->BaudRate = atoi(ptr);
-        	dprintf_info(comm,"BuildCommDCB: baudrate (%d)\n", lpdcb->BaudRate);
+        	TRACE(comm,"baudrate (%d)\n", lpdcb->BaudRate);
 
 		ptr = strtok(NULL, ", ");
 		if (islower(*ptr))
 			*ptr = toupper(*ptr);
 
-        	dprintf_info(comm,"BuildCommDCB: parity (%c)\n", *ptr);
+        	TRACE(comm,"parity (%c)\n", *ptr);
 		lpdcb->fParity = 1;
 		switch (*ptr) {
 			case 'N':
@@ -235,11 +232,11 @@
 		}
 
 		ptr = strtok(NULL, ", "); 
-         	dprintf_info(comm, "BuildCommDCB: charsize (%c)\n", *ptr);
+         	TRACE(comm, "charsize (%c)\n", *ptr);
 		lpdcb->ByteSize = *ptr - '0';
 
 		ptr = strtok(NULL, ", ");
-        	dprintf_info(comm, "BuildCommDCB: stopbits (%c)\n", *ptr);
+        	TRACE(comm, "stopbits (%c)\n", *ptr);
 		switch (*ptr) {
 			case '1':
 				lpdcb->StopBits = ONESTOPBIT;
@@ -273,7 +270,7 @@
 	int	port;
 	char	*ptr,*temp;
 
-	dprintf_info(comm,"BuildCommDCBAndTimeouts32A(%s,%p,%p)\n",device,lpdcb,lptimeouts);
+	TRACE(comm,"(%s,%p,%p)\n",device,lpdcb,lptimeouts);
 	commerror = 0;
 
 	if (!lstrncmpi32A(device,"COM",3)) {
@@ -400,7 +397,7 @@
 	LPSTR	devidA;
 	BOOL32	ret;
 
-	dprintf_info(comm,"BuildCommDCBAndTimeouts32W(%p,%p,%p)\n",devid,lpdcb,lptimeouts);
+	TRACE(comm,"(%p,%p,%p)\n",devid,lpdcb,lptimeouts);
 	devidA = HEAP_strdupWtoA( GetProcessHeap(), 0, devid );
 	ret=BuildCommDCBAndTimeouts32A(devidA,lpdcb,lptimeouts);
         HeapFree( GetProcessHeap(), 0, devidA );
@@ -422,8 +419,7 @@
 {
 	int port,fd;
 
-    	dprintf_info(comm,
-		"OpenComm: %s, %d, %d\n", device, cbInQueue, cbOutQueue);
+    	TRACE(comm, "%s, %d, %d\n", device, cbInQueue, cbOutQueue);
 	commerror = 0;
 
 	if (!lstrncmpi32A(device,"COM",3)) {
@@ -434,8 +430,7 @@
 			commerror = IE_BADID;
 		}
 
-                dprintf_info(comm,
-                       "OpenComm: %s = %s\n", device, COM[port].devicename);
+                TRACE(comm, "%s = %s\n", device, COM[port].devicename);
 
 		if (!ValidCOMPort(port)) {
 			commerror = IE_BADID;
@@ -487,7 +482,7 @@
 INT16 WINAPI CloseComm(INT16 fd)
 {
         int port;
-    	dprintf_info(comm,"CloseComm: fd %d\n", fd);
+    	TRACE(comm,"fd %d\n", fd);
        	if ((port = GetCommPort(fd)) !=-1) {  /* [LW]       */
     	        SEGPTR_FREE(unknown[port]); 
     	        COM[port].fd = 0;       /*  my adaptation of RER's fix   */  
@@ -512,7 +507,7 @@
 {
 	struct DosDeviceStruct *ptr;
 
-	dprintf_info(comm,"SetCommBreak: fd: %d\n", fd);
+	TRACE(comm,"fd=%d\n", fd);
 	if ((ptr = GetDeviceStruct(fd)) == NULL) {
 		commerror = IE_BADID;
 		return -1;
@@ -531,7 +526,7 @@
 
 	struct DosDeviceStruct *ptr;
 
-	dprintf_info(comm,"SetCommBreak: fd: %d\n", fd);
+	TRACE(comm,"fd=%d\n", fd);
 	if ((ptr = GetDeviceStruct(fd)) == NULL) {
 		commerror = IE_BADID;
 		return FALSE;
@@ -549,7 +544,7 @@
 {
 	struct DosDeviceStruct *ptr;
 
-    	dprintf_info(comm,"ClearCommBreak: fd: %d\n", fd);
+    	TRACE(comm,"fd=%d\n", fd);
 	if ((ptr = GetDeviceStruct(fd)) == NULL) {
 		commerror = IE_BADID;
 		return -1;
@@ -567,7 +562,7 @@
 {
 	struct DosDeviceStruct *ptr;
 
-    	dprintf_info(comm,"ClearCommBreak: fd: %d\n", fd);
+    	TRACE(comm,"fd=%d\n", fd);
 	if ((ptr = GetDeviceStruct(fd)) == NULL) {
 		commerror = IE_BADID;
 		return FALSE;
@@ -586,7 +581,7 @@
 	int	max;
 	struct termios port;
 
-    	dprintf_info(comm,"EscapeCommFunction fd: %d, function: %d\n", fd, nFunction);
+    	TRACE(comm,"fd=%d, function=%d\n", fd, nFunction);
 	if (tcgetattr(fd,&port) == -1) {
 		commerror=WinError();	
 		return -1;
@@ -662,7 +657,7 @@
 	struct termios	port;
 	struct DosDeviceStruct *ptr;
 
-    	dprintf_info(comm,"EscapeCommFunction fd: %d, function: %d\n", fd, nFunction);
+    	TRACE(comm,"fd=%d, function=%d\n", fd, nFunction);
 	if (tcgetattr(fd,&port) == -1) {
 		commerror=WinError();	
 		return FALSE;
@@ -734,7 +729,7 @@
 {
 	int queue;
 
-    	dprintf_info(comm,"FlushComm fd: %d, queue: %d\n", fd, fnQueue);
+    	TRACE(comm,"fd=%d, queue=%d\n", fd, fnQueue);
 	switch (fnQueue) {
 		case 0:	queue = TCOFLUSH;
 			break;
@@ -759,7 +754,7 @@
  */
 BOOL32 WINAPI PurgeComm( HANDLE32 hFile, DWORD flags) 
 {
-    dprintf_fixme(comm, "PurgeComm(%08x %08lx) unimplemented stub\n",
+    FIXME(comm, "(%08x %08lx) unimplemented stub\n",
                  hFile, flags);
     return 0;
 }
@@ -784,15 +779,13 @@
                 if (rc) fprintf(stderr, "Error !\n");
 		lpStat->cbInQue = cnt;
 
-    		dprintf_info(comm,
-		       "GetCommError: fd %d, error %d, lpStat %d %d %d\n",
-		       fd, commerror, lpStat->status, lpStat->cbInQue, 
-		       lpStat->cbOutQue);
+    		TRACE(comm, "fd %d, error %d, lpStat %d %d %d\n",
+			     fd, commerror, lpStat->status, lpStat->cbInQue, 
+			     lpStat->cbOutQue);
 	}
 	else
-		dprintf_info(comm,
-		       "GetCommError: fd %d, error %d, lpStat NULL\n",
-		       fd, commerror);
+		TRACE(comm, "fd %d, error %d, lpStat NULL\n",
+			     fd, commerror);
 
 	/*
 	 * [RER] I have no idea what the following is trying to accomplish.
@@ -810,7 +803,7 @@
 {
 	int temperror;
 
-    	dprintf_info(comm, "ClearCommError: fd %d (current error %d)\n", 
+    	TRACE(comm, "fd %d (current error %d)\n", 
 	       fd, commerror);
 	temperror = commerror;
 	commerror = 0;
@@ -826,18 +819,18 @@
         int act;
         int repid;
         unsigned int mstat;
-    	dprintf_info(comm,"SetCommEventMask:fd %d,mask %d\n",fd,fuEvtMask);
+    	TRACE(comm,"fd %d,mask %d\n",fd,fuEvtMask);
 	eventmask |= fuEvtMask;
         if ((act = GetCommPort(fd)) == -1) {
-            dprintf_warn(comm," fd %d not comm port\n",act);
+            WARN(comm," fd %d not comm port\n",act);
             return NULL;}
         stol =  unknown[act];
         stol += msr;    
 	repid = ioctl(fd,TIOCMGET,&mstat);
-	dprintf_info(comm, " ioctl  %d, msr %x at %p %p\n",repid,mstat,stol,unknown[act]);
+	TRACE(comm, " ioctl  %d, msr %x at %p %p\n",repid,mstat,stol,unknown[act]);
 	if ((mstat&TIOCM_CAR)) {*stol |= 0x80;}
 	     else {*stol &=0x7f;}
-	dprintf_info(comm," modem dcd construct %x\n",*stol);
+	TRACE(comm," modem dcd construct %x\n",*stol);
 	return SEGPTR_GET(unknown[act]);	
 }
 
@@ -848,8 +841,7 @@
 {
 	int	events = 0;
 
-    	dprintf_info(comm,
-		"GetCommEventMask: fd %d, mask %d\n", fd, fnEvtClear);
+    	TRACE(comm, "fd %d, mask %d\n", fd, fnEvtClear);
 
 	/*
 	 *	Determine if any characters are available
@@ -862,8 +854,7 @@
 		rc = ioctl(fd, TIOCINQ, &cnt);
 		if (cnt) events |= EV_RXCHAR;
 
-		dprintf_info(comm,
-			"GetCommEventMask: rxchar %ld\n", cnt);
+		TRACE(comm, "rxchar %ld\n", cnt);
 	}
 
 	/*
@@ -871,8 +862,7 @@
 	 */
 	/* TODO */
 
-	dprintf_info(comm,
-		"GetCommEventMask: return events %d\n", events);
+	TRACE(comm, "return events %d\n", events);
 	return events;
 
 	/*
@@ -890,7 +880,7 @@
  */
 BOOL32 WINAPI SetupComm( HANDLE32 hFile, DWORD insize, DWORD outsize)
 {
-        dprintf_fixme(comm, "SetupComm: insize %ld outsize %ld unimplemented stub\n", insize, outsize);
+        FIXME(comm, "insize %ld outsize %ld unimplemented stub\n", insize, outsize);
        return FALSE;
 } 
 
@@ -899,8 +889,7 @@
  */
 BOOL32 WINAPI GetCommMask(INT32 fd,LPDWORD evtmask)
 {
-    	dprintf_info(comm,
-		"GetCommMask: fd %d, mask %p\n", fd, evtmask);
+    	TRACE(comm, "fd %d, mask %p\n", fd, evtmask);
 	*evtmask = eventmask;
 	return TRUE;
 }
@@ -910,8 +899,7 @@
  */
 BOOL32 WINAPI SetCommMask(INT32 fd,DWORD evtmask)
 {
-    	dprintf_info(comm,
-		"SetCommMask: fd %d, mask %lx\n", fd, evtmask);
+    	TRACE(comm, "fd %d, mask %lx\n", fd, evtmask);
 	eventmask = evtmask;
 	return TRUE;
 }
@@ -924,8 +912,7 @@
 	struct termios port;
 	struct DosDeviceStruct *ptr;
 
-    	dprintf_info(comm,
-		"SetCommState16: fd %d, ptr %p\n", lpdcb->Id, lpdcb);
+    	TRACE(comm, "fd %d, ptr %p\n", lpdcb->Id, lpdcb);
 	if (tcgetattr(lpdcb->Id, &port) == -1) {
 		commerror = WinError();	
 		return -1;
@@ -955,7 +942,7 @@
 	}
 	if (ptr->baudrate > 0)
 	  	lpdcb->BaudRate = ptr->baudrate;
-    	dprintf_info(comm,"SetCommState: baudrate %d\n",lpdcb->BaudRate);
+    	TRACE(comm,"baudrate %d\n",lpdcb->BaudRate);
 #ifdef CBAUD
 	port.c_cflag &= ~CBAUD;
 	switch (lpdcb->BaudRate) {
@@ -1049,7 +1036,7 @@
         }
         port.c_ispeed = port.c_ospeed;
 #endif
-    	dprintf_info(comm,"SetCommState: bytesize %d\n",lpdcb->ByteSize);
+    	TRACE(comm,"bytesize %d\n",lpdcb->ByteSize);
 	port.c_cflag &= ~CSIZE;
 	switch (lpdcb->ByteSize) {
 		case 5:
@@ -1069,7 +1056,7 @@
 			return -1;
 	}
 
-    	dprintf_info(comm,"SetCommState: parity %d\n",lpdcb->Parity);
+    	TRACE(comm,"parity %d\n",lpdcb->Parity);
 	port.c_cflag &= ~(PARENB | PARODD);
 	if (lpdcb->fParity)
 		switch (lpdcb->Parity) {
@@ -1090,7 +1077,7 @@
 		}
 	
 
-    	dprintf_info(comm,"SetCommState: stopbits %d\n",lpdcb->StopBits);
+    	TRACE(comm,"stopbits %d\n",lpdcb->StopBits);
 
 	switch (lpdcb->StopBits) {
 		case ONESTOPBIT:
@@ -1137,7 +1124,7 @@
 	struct termios port;
 	struct DosDeviceStruct *ptr;
 
-    	dprintf_info(comm,"SetCommState32: fd %d, ptr %p\n",fd,lpdcb);
+    	TRACE(comm,"fd %d, ptr %p\n",fd,lpdcb);
 	if (tcgetattr(fd,&port) == -1) {
 		commerror = WinError();	
 		return FALSE;
@@ -1167,7 +1154,7 @@
 	}
 	if (ptr->baudrate > 0)
 	  	lpdcb->BaudRate = ptr->baudrate;
-    	dprintf_info(comm,"SetCommState: baudrate %ld\n",lpdcb->BaudRate);
+    	TRACE(comm,"baudrate %ld\n",lpdcb->BaudRate);
 #ifdef CBAUD
 	port.c_cflag &= ~CBAUD;
 	switch (lpdcb->BaudRate) {
@@ -1255,7 +1242,7 @@
         }
         port.c_ispeed = port.c_ospeed;
 #endif
-    	dprintf_info(comm,"SetCommState: bytesize %d\n",lpdcb->ByteSize);
+    	TRACE(comm,"bytesize %d\n",lpdcb->ByteSize);
 	port.c_cflag &= ~CSIZE;
 	switch (lpdcb->ByteSize) {
 		case 5:
@@ -1275,7 +1262,7 @@
 			return FALSE;
 	}
 
-    	dprintf_info(comm,"SetCommState: parity %d\n",lpdcb->Parity);
+    	TRACE(comm,"parity %d\n",lpdcb->Parity);
 	port.c_cflag &= ~(PARENB | PARODD);
 	if (lpdcb->fParity)
 		switch (lpdcb->Parity) {
@@ -1296,7 +1283,7 @@
 		}
 	
 
-    	dprintf_info(comm,"SetCommState: stopbits %d\n",lpdcb->StopBits);
+    	TRACE(comm,"stopbits %d\n",lpdcb->StopBits);
 	switch (lpdcb->StopBits) {
 		case ONESTOPBIT:
 				port.c_cflag &= ~CSTOPB;
@@ -1344,7 +1331,7 @@
 {
 	struct termios port;
 
-    	dprintf_info(comm,"GetCommState16: fd %d, ptr %p\n", fd, lpdcb);
+    	TRACE(comm,"fd %d, ptr %p\n", fd, lpdcb);
 	if (tcgetattr(fd, &port) == -1) {
 		commerror = WinError();	
 		return -1;
@@ -1469,7 +1456,7 @@
 {
 	struct termios	port;
 
-    	dprintf_info(comm,"GetCommState32: fd %d, ptr %p\n", fd, lpdcb);
+    	TRACE(comm,"fd %d, ptr %p\n", fd, lpdcb);
         if (GetDeviceStruct(fd) == NULL) return FALSE;
 	if (tcgetattr(fd, &port) == -1) {
 		commerror = WinError();	
@@ -1585,8 +1572,7 @@
 {
 	struct DosDeviceStruct *ptr;
 
-    	dprintf_info(comm,
-		"TransmitCommChar: fd %d, data %d \n", fd, chTransmit);
+    	TRACE(comm, "fd %d, data %d \n", fd, chTransmit);
 	if ((ptr = GetDeviceStruct(fd)) == NULL) {
 		commerror = IE_BADID;
 		return -1;
@@ -1613,7 +1599,7 @@
 {
 	struct DosDeviceStruct *ptr;
 
-    	dprintf_info(comm,"TransmitCommChar32(%d,'%c')\n",fd,chTransmit);
+    	TRACE(comm,"(%d,'%c')\n",fd,chTransmit);
 	if ((ptr = GetDeviceStruct(fd)) == NULL) {
 		commerror = IE_BADID;
 		return FALSE;
@@ -1639,7 +1625,7 @@
 {
 	struct DosDeviceStruct *ptr;
 
-    	dprintf_info(comm,"UngetCommChar: fd %d (char %d)\n", fd, chUnget);
+    	TRACE(comm,"fd %d (char %d)\n", fd, chUnget);
 	if ((ptr = GetDeviceStruct(fd)) == NULL) {
 		commerror = IE_BADID;
 		return -1;
@@ -1664,8 +1650,7 @@
 	int status, length;
 	struct DosDeviceStruct *ptr;
 
-    	dprintf_info(comm,
-	    "ReadComm: fd %d, ptr %p, length %d\n", fd, lpvBuf, cbRead);
+    	TRACE(comm, "fd %d, ptr %p, length %d\n", fd, lpvBuf, cbRead);
 	if ((ptr = GetDeviceStruct(fd)) == NULL) {
 		commerror = IE_BADID;
 		return -1;
@@ -1696,7 +1681,7 @@
                         return length;
                 }
  	} else {
-	        dprintf_info(comm,"%*s\n", length+status, lpvBuf);
+	        TRACE(comm,"%*s\n", length+status, lpvBuf);
 		commerror = 0;
 		return length + status;
 	}
@@ -1710,7 +1695,7 @@
 	int length;
 	struct DosDeviceStruct *ptr;
 
-    	dprintf_info(comm,"WriteComm: fd %d, ptr %p, length %d\n", 
+    	TRACE(comm,"fd %d, ptr %p, length %d\n", 
 		fd, lpvBuf, cbWrite);
 	if ((ptr = GetDeviceStruct(fd)) == NULL) {
 		commerror = IE_BADID;
@@ -1722,7 +1707,7 @@
 		return -1;
 	}	
 	
-	dprintf_info(comm,"%*s\n", cbWrite, lpvBuf );
+	TRACE(comm,"%*s\n", cbWrite, lpvBuf );
 	length = write(fd, (void *) lpvBuf, cbWrite);
 	
 	if (length == -1) {
diff --git a/misc/commdlg.c b/misc/commdlg.c
index c0f2a12..85c0f2b 100644
--- a/misc/commdlg.c
+++ b/misc/commdlg.c
@@ -137,7 +137,7 @@
 		    FreeResource16( hDlgTmpl );
     }
 
-    dprintf_info(commdlg,"GetOpenFileName // return lpstrFile='%s' !\n", 
+    TRACE(commdlg,"return lpstrFile='%s' !\n", 
            (LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrFile));
     return bRet;
 }
@@ -231,7 +231,7 @@
 		    FreeResource16( hDlgTmpl );
     }
 
-    dprintf_info(commdlg, "GetSaveFileName // return lpstrFile='%s' !\n", 
+    TRACE(commdlg, "return lpstrFile='%s' !\n", 
             (LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrFile));
     return bRet;
 }
@@ -483,7 +483,7 @@
     {
       pstr = (LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrCustomFilter);
       n = 0;
-      dprintf_info(commdlg,"lpstrCustomFilter = %p\n", pstr);
+      TRACE(commdlg,"lpstrCustomFilter = %p\n", pstr);
       while(*pstr)
 	{
 	  old_pstr = pstr;
@@ -491,7 +491,7 @@
                                    (LPARAM)lpofn->lpstrCustomFilter + n );
           n += strlen(pstr) + 1;
 	  pstr += strlen(pstr) + 1;
-	  dprintf_info(commdlg,"lpstrCustomFilter // add str='%s' "
+	  TRACE(commdlg,"add str='%s' "
 			  "associated to '%s'\n", old_pstr, pstr);
           SendDlgItemMessage16(hWnd, cmb1, CB_SETITEMDATA16, i, (LPARAM)pstr);
           n += strlen(pstr) + 1;
@@ -508,7 +508,7 @@
 				       (LPARAM)lpofn->lpstrFilter + n );
 	  n += strlen(pstr) + 1;
 	  pstr += strlen(pstr) + 1;
-	  dprintf_info(commdlg,"lpstrFilter // add str='%s' "
+	  TRACE(commdlg,"add str='%s' "
 			  "associated to '%s'\n", old_pstr, pstr);
 	  SendDlgItemMessage16(hWnd, cmb1, CB_SETITEMDATA16, i, (LPARAM)pstr);
 	  n += strlen(pstr) + 1;
@@ -522,7 +522,7 @@
   strncpy(tmpstr, FILEDLG_GetFileType(PTR_SEG_TO_LIN(lpofn->lpstrCustomFilter),
 	     PTR_SEG_TO_LIN(lpofn->lpstrFilter), lpofn->nFilterIndex - 1),511);
   tmpstr[511]=0;
-  dprintf_info(commdlg,"nFilterIndex = %ld // SetText of edt1 to '%s'\n", 
+  TRACE(commdlg,"nFilterIndex = %ld, SetText of edt1 to '%s'\n", 
   			lpofn->nFilterIndex, tmpstr);
   SetDlgItemText32A( hWnd, edt1, tmpstr );
   /* get drive list */
@@ -637,7 +637,7 @@
       if (lRet == LB_ERR)
 	return TRUE;
       pstr = (LPSTR)SendDlgItemMessage16(hWnd, cmb1, CB_GETITEMDATA16, lRet, 0);
-      dprintf_info(commdlg,"Selected filter : %s\n", pstr);
+      TRACE(commdlg,"Selected filter : %s\n", pstr);
       SetDlgItemText32A( hWnd, edt1, pstr );
       FILEDLG_ScanDir(hWnd, tmpstr);
       return TRUE;
@@ -665,7 +665,7 @@
 	      strcpy(tmpstr2, tmpstr);
 	      *tmpstr=0;
 	    }
-	  dprintf_info(commdlg,"commdlg: %s, %s\n", tmpstr, tmpstr2);
+	  TRACE(commdlg,"tmpstr=%s, tmpstr2=%s\n", tmpstr, tmpstr2);
           SetDlgItemText32A( hWnd, edt1, tmpstr2 );
 	  FILEDLG_ScanDir(hWnd, tmpstr);
 	  return TRUE;
@@ -678,7 +678,7 @@
       lRet = SendDlgItemMessage16(hWnd, cmb1, CB_GETCURSEL16, 0, 0);
       if (lRet == LB_ERR) return TRUE;
       lpofn->nFilterIndex = lRet + 1;
-      dprintf_info(commdlg,"commdlg: lpofn->nFilterIndex=%ld\n", lpofn->nFilterIndex);
+      TRACE(commdlg,"lpofn->nFilterIndex=%ld\n", lpofn->nFilterIndex);
       lstrcpyn32A(tmpstr2, 
 	     FILEDLG_GetFileType(PTR_SEG_TO_LIN(lpofn->lpstrCustomFilter),
 				 PTR_SEG_TO_LIN(lpofn->lpstrFilter),
@@ -1128,7 +1128,7 @@
     HWND32 hwndDialog;
     LPPRINTDLG16 lpPrint = (LPPRINTDLG16)PTR_SEG_TO_LIN(printdlg);
 
-    dprintf_info(commdlg,"PrintDlg(%p) // Flags=%08lX\n", lpPrint, lpPrint->Flags );
+    TRACE(commdlg,"(%p) -- Flags=%08lX\n", lpPrint, lpPrint->Flags );
 
     if (lpPrint->Flags & PD_RETURNDEFAULT)
         /* FIXME: should fill lpPrint->hDevMode and lpPrint->hDevNames here */
@@ -1180,7 +1180,7 @@
   switch (wMsg)
     {
     case WM_INITDIALOG:
-      dprintf_info(commdlg,"PrintDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
+      TRACE(commdlg,"WM_INITDIALOG lParam=%08lX\n", lParam);
       ShowWindow16(hWnd, SW_SHOWNORMAL);
       return (TRUE);
     case WM_COMMAND:
@@ -1208,7 +1208,7 @@
   switch (wMsg)
     {
     case WM_INITDIALOG:
-      dprintf_info(commdlg,"PrintSetupDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
+      TRACE(commdlg,"WM_INITDIALOG lParam=%08lX\n", lParam);
       ShowWindow16(hWnd, SW_SHOWNORMAL);
       return (TRUE);
     case WM_COMMAND:
@@ -1240,7 +1240,7 @@
 short WINAPI GetFileTitle32A(LPCSTR lpFile, LPSTR lpTitle, UINT32 cbBuf)
 {
     int i, len;
-    dprintf_info(commdlg,"GetFileTitle(%p %p %d); \n", lpFile, lpTitle, cbBuf);
+    TRACE(commdlg,"(%p %p %d); \n", lpFile, lpTitle, cbBuf);
     if (lpFile == NULL || lpTitle == NULL)
     	return -1;
     len = strlen(lpFile);
@@ -1257,7 +1257,7 @@
 	i++;
 	break;
     }
-    dprintf_info(commdlg,"---> '%s' \n", &lpFile[i]);
+    TRACE(commdlg,"---> '%s' \n", &lpFile[i]);
     
     len = strlen(lpFile+i)+1;
     if (cbBuf < len)
@@ -1306,7 +1306,7 @@
     LPCVOID template;
     HWND32 hwndDialog;
 
-    dprintf_info(commdlg,"ChooseColor\n");
+    TRACE(commdlg,"ChooseColor\n");
     if (!lpChCol) return FALSE;    
 
     if (lpChCol->Flags & CC_ENABLETEMPLATEHANDLE)
@@ -2070,7 +2070,7 @@
    POINT16 point;
    struct CCPRIVATE * lpp; 
    
-   dprintf_info(commdlg,"ColorDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
+   TRACE(commdlg,"WM_INITDIALOG lParam=%08lX\n", lParam);
    lpp=calloc(1,sizeof(struct CCPRIVATE));
    lpp->lpcc=(LPCHOOSECOLOR)lParam;
    if (lpp->lpcc->lStructSize != sizeof(CHOOSECOLOR))
@@ -2139,7 +2139,7 @@
     HDC32 hdc;
     COLORREF *cr;
     struct CCPRIVATE * lpp=(struct CCPRIVATE *)GetWindowLong32A(hDlg, DWL_USER); 
-    dprintf_info(commdlg,"CC_WMCommand wParam=%x lParam=%lx\n",wParam,lParam);
+    TRACE(commdlg,"CC_WMCommand wParam=%x lParam=%lx\n",wParam,lParam);
     switch (wParam)
     {
           case 0x2c2:  /* edit notify RGB */
@@ -2401,7 +2401,7 @@
     LPCVOID template;
     HWND32 hwndDialog;
 
-    dprintf_info(commdlg,"ChooseFont\n");
+    TRACE(commdlg,"ChooseFont\n");
     if (!lpChFont) return FALSE;    
 
     if (lpChFont->Flags & CF_ENABLETEMPLATEHANDLE)
@@ -2483,8 +2483,7 @@
   LPCHOOSEFONT lpcf=(LPCHOOSEFONT)GetWindowLong32A(hDlg, DWL_USER); 
   LOGFONT16 *lplf = (LOGFONT16 *)PTR_SEG_TO_LIN( logfont );
 
-  dprintf_info(commdlg,"FontFamilyEnumProc: font=%s (nFontType=%d)\n",
-     			lplf->lfFaceName,nFontType);
+  TRACE(commdlg,"font=%s (nFontType=%d)\n", lplf->lfFaceName,nFontType);
 
   if (lpcf->Flags & CF_FIXEDPITCHONLY)
    if (!(lplf->lfPitchAndFamily & FIXED_PITCH))
@@ -2602,11 +2601,14 @@
   TEXTMETRIC16 *lptm = (TEXTMETRIC16 *)PTR_SEG_TO_LIN(metrics);
   int i;
   
-  dprintf_info(commdlg,"FontStyleEnumProc: (nFontType=%d)\n",nFontType);
-  dprintf_info(commdlg,"  %s h=%d w=%d e=%d o=%d wg=%d i=%d u=%d s=%d ch=%d op=%d cp=%d q=%d pf=%xh\n",
-	lplf->lfFaceName,lplf->lfHeight,lplf->lfWidth,lplf->lfEscapement,lplf->lfOrientation,
-	lplf->lfWeight,lplf->lfItalic,lplf->lfUnderline,lplf->lfStrikeOut,lplf->lfCharSet,
-	lplf->lfOutPrecision,lplf->lfClipPrecision,lplf->lfQuality,lplf->lfPitchAndFamily);
+  TRACE(commdlg,"(nFontType=%d)\n",nFontType);
+  TRACE(commdlg,"  %s h=%d w=%d e=%d o=%d wg=%d i=%d u=%d s=%d"
+	       " ch=%d op=%d cp=%d q=%d pf=%xh\n",
+	       lplf->lfFaceName,lplf->lfHeight,lplf->lfWidth,
+	       lplf->lfEscapement,lplf->lfOrientation,
+	       lplf->lfWeight,lplf->lfItalic,lplf->lfUnderline,
+	       lplf->lfStrikeOut,lplf->lfCharSet, lplf->lfOutPrecision,
+	       lplf->lfClipPrecision,lplf->lfQuality, lplf->lfPitchAndFamily);
 
   if (SetFontSizesToCombo3(hcmb3, lplf ,lpcf))
    return 0;
@@ -2639,11 +2641,11 @@
   SetWindowLong32A(hDlg, DWL_USER, lParam); 
   lpcf=(LPCHOOSEFONT)lParam;
   lpxx=PTR_SEG_TO_LIN(lpcf->lpLogFont);
-  dprintf_info(commdlg,"FormatCharDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
+  TRACE(commdlg,"WM_INITDIALOG lParam=%08lX\n", lParam);
 
   if (lpcf->lStructSize != sizeof(CHOOSEFONT))
   {
-    dprintf_err(commdlg,"WM_INITDIALOG: structure size failure !!!\n");
+    ERR(commdlg,"structure size failure !!!\n");
     EndDialog32 (hDlg, 0); 
     return FALSE;
   }
@@ -2682,7 +2684,7 @@
   {
     if (!EnumFontFamilies16(hdc, NULL,FontFamilyEnumProc,
                             (LPARAM)GetDlgItem32(hDlg,cmb1)))
-      dprintf_info(commdlg,"WM_INITDIALOG: EnumFontFamilies returns 0\n");
+      TRACE(commdlg,"EnumFontFamilies returns 0\n");
     if (lpcf->Flags & CF_INITTOLOGFONTSTRUCT)
     {
       /* look for fitting font name in combobox1 */
@@ -2729,7 +2731,7 @@
   }
   else
   {
-    dprintf_warn(commdlg,"WM_INITDIALOG: HDC failure !!!\n");
+    WARN(commdlg,"HDC failure !!!\n");
     EndDialog32 (hDlg, 0); 
     return FALSE;
   }
@@ -2794,7 +2796,7 @@
    buffer = SEGPTR_ALLOC(40);
    switch (lpdi->CtlID)
    {
-    case cmb1:	/* dprintf_info(commdlg,"WM_Drawitem cmb1\n"); */
+    case cmb1:	/* TRACE(commdlg,"WM_Drawitem cmb1\n"); */
 		SendMessage16(lpdi->hwndItem, CB_GETLBTEXT16, lpdi->itemID,
 			(LPARAM)SEGPTR_GET(buffer));	          
 		GetObject16( hBitmapTT, sizeof(bm), &bm );
@@ -2815,14 +2817,14 @@
 #endif
 		break;
     case cmb2:
-    case cmb3:	/* dprintf_info(commdlg,"WM_DRAWITEN cmb2,cmb3\n"); */
+    case cmb3:	/* TRACE(commdlg,"WM_DRAWITEN cmb2,cmb3\n"); */
 		SendMessage16(lpdi->hwndItem, CB_GETLBTEXT16, lpdi->itemID,
 			(LPARAM)SEGPTR_GET(buffer));
 		TextOut16(lpdi->hDC, lpdi->rcItem.left,
                           lpdi->rcItem.top, buffer, lstrlen16(buffer));
 		break;
 
-    case cmb4:	/* dprintf_info(commdlg,"WM_DRAWITEM cmb4 (=COLOR)\n"); */
+    case cmb4:	/* TRACE(commdlg,"WM_DRAWITEM cmb4 (=COLOR)\n"); */
 		SendMessage16(lpdi->hwndItem, CB_GETLBTEXT16, lpdi->itemID,
     		    (LPARAM)SEGPTR_GET(buffer));
 		TextOut16(lpdi->hDC, lpdi->rcItem.left +  25+5,
@@ -2881,7 +2883,7 @@
   LPCHOOSEFONT lpcf=(LPCHOOSEFONT)GetWindowLong32A(hDlg, DWL_USER); 
   LPLOGFONT16 lpxx=PTR_SEG_TO_LIN(lpcf->lpLogFont);
   
-  dprintf_info(commdlg,"FormatCharDlgProc // WM_COMMAND lParam=%08lX\n", lParam);
+  TRACE(commdlg,"WM_COMMAND lParam=%08lX\n", lParam);
   switch (wParam)
   {
 	case cmb1:if (HIWORD(lParam)==CBN_SELCHANGE)
@@ -2898,7 +2900,7 @@
                         char *str = SEGPTR_ALLOC(256);
                         SendDlgItemMessage16(hDlg,cmb1,CB_GETLBTEXT16,i,
                                              (LPARAM)SEGPTR_GET(str));
-	                dprintf_info(commdlg,"WM_COMMAND/cmb1 =>%s\n",str);
+	                TRACE(commdlg,"WM_COMMAND/cmb1 =>%s\n",str);
        		        EnumFontFamilies16(hdc,str,FontStyleEnumProc,
 		             MAKELONG(GetDlgItem32(hDlg,cmb2),GetDlgItem32(hDlg,cmb3)));
 		        SetCursor16(hcursor);
@@ -2909,7 +2911,7 @@
  		    }
  		    else
                     {
-                      dprintf_warn(commdlg,"WM_COMMAND: HDC failure !!!\n");
+                      WARN(commdlg,"HDC failure !!!\n");
                       EndDialog32 (hDlg, 0); 
                       return TRUE;
                     }
@@ -2920,7 +2922,7 @@
 	case cmb3:if (HIWORD(lParam)==CBN_SELCHANGE || HIWORD(lParam)== BN_CLICKED )
 	          {
                     char *str = SEGPTR_ALLOC(256);
-                    dprintf_info(commdlg,"WM_COMMAND/cmb2,3 =%08lX\n", lParam);
+                    TRACE(commdlg,"WM_COMMAND/cmb2,3 =%08lX\n", lParam);
 		    i=SendDlgItemMessage16(hDlg,cmb1,CB_GETCURSEL16,0,0);
 		    if (i==CB_ERR)
                       i=GetDlgItemText32A( hDlg, cmb1, str, 256 );
@@ -3036,9 +3038,9 @@
       case WM_COMMAND:
                         return CFn_WMCommand(hDlg,wParam,lParam);
       case WM_CHOOSEFONT_GETLOGFONT: 
-                         dprintf_info(commdlg,
-                          "FormatCharDlgProc // WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n", lParam);
-                        /* FIXME:  current logfont back to caller */
+                         TRACE(commdlg,"WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n",
+				      lParam);
+			 FIXME(commdlg, "current logfont back to caller\n");
                         break;
     }
   return FALSE;
diff --git a/misc/crtdll.c b/misc/crtdll.c
index 7ca8fb9..ac5beeb 100644
--- a/misc/crtdll.c
+++ b/misc/crtdll.c
@@ -82,13 +82,12 @@
 	int	xargc,i,afterlastspace;
 	DWORD	version;
 
-	dprintf_info(crtdll,"CRTDLL__GetMainArgs(%p,%p,%p,%ld).\n",
+	TRACE(crtdll,"(%p,%p,%p,%ld).\n",
 		argc,argv,environ,flag
 	);
 	CRTDLL_acmdln_dll = cmdline = HEAP_strdupA( GetProcessHeap(), 0,
                                                     GetCommandLine32A() );
- 	dprintf_info(crtdll,"CRTDLL__GetMainArgs got \"%s\"\n",
-		cmdline);
+ 	TRACE(crtdll,"got '%s'\n", cmdline);
 
 	version	= GetVersion32();
 	CRTDLL_osver_dll       = version >> 16;
@@ -130,7 +129,7 @@
 	CRTDLL_argv_dll	= xargv;
 	*argv		= xargv;
 
-	dprintf_info(crtdll,"CRTDLL__GetMainArgs found %d arguments\n",
+	TRACE(crtdll,"found %d arguments\n",
 		CRTDLL_argc_dll);
 	CRTDLL_environ_dll = *environ = GetEnvironmentStrings32A();
 	return 0;
@@ -146,7 +145,7 @@
 {
 	_INITTERMFUN	*current;
 
-	dprintf_info(crtdll,"_initterm(%p,%p)\n",start,end);
+	TRACE(crtdll,"(%p,%p)\n",start,end);
 	current=start;
 	while (current<end) {
 		if (*current) (*current)();
@@ -173,9 +172,8 @@
     default:
       file=fdopen(handle,mode);
     }
-  dprintf_info(crtdll,
-		 "CRTDLL_fdopen open handle %d mode %s  got file %p\n",
-		 handle, mode, file);
+  TRACE(crtdll, "open handle %d mode %s  got file %p\n",
+	       handle, mode, file);
   return (DWORD)file;
 }
 
@@ -199,7 +197,7 @@
     DWORD *args = (DWORD *)ESP_reg(context);
     PEXCEPTION_FRAME endframe = (PEXCEPTION_FRAME)args[1];
     DWORD nr = args[2];
-    fprintf(stderr,"CRTDLL__local_unwind2(%p,%ld)\n",endframe,nr);
+    fprintf(stderr,"(%p,%ld)\n",endframe,nr);
 }
 
 /*********************************************************************
@@ -213,7 +211,7 @@
   DOS_FULL_NAME full_name;
   
   if (!DOSFS_GetFullName( path, FALSE, &full_name )) {
-    dprintf_warn(crtdll, "CRTDLL_fopen file %s bad name\n",path);
+    WARN(crtdll, "file %s bad name\n",path);
    return 0;
   }
   
@@ -234,15 +232,13 @@
   else if (strstr(mode,"a+")) flagmode= O_RDWR | O_CREAT | O_APPEND;
   else if (strchr(mode,'w')) flagmode = O_RDWR | O_CREAT | O_APPEND;
   else if (strchr(mode,'b'))
-    dprintf_info(crtdll,
-		   "CRTDLL_fopen %s in BINARY mode\n",path);
+    TRACE(crtdll, "%s in BINARY mode\n",path);
       
   dos_fildes=FILE_Open(path, flagmode);
   unix_fildes=FILE_GetUnixHandle(dos_fildes);
   file = fdopen(unix_fildes,mode);
 
-  dprintf_info(crtdll,
-		 "CRTDLL_fopen file %s mode %s got ufh %d dfh %d file %p\n",
+  TRACE(crtdll, "file %s mode %s got ufh %d dfh %d file %p\n",
 		 path,mode,unix_fildes,dos_fildes,file);
   return (DWORD)file;
 }
@@ -262,32 +258,29 @@
      known binary extensions must be unchanged */
   while ( (i < (nmemb*size)) && (ret==1)) {
     ret=fread(temp,1,1,file);
-    dprintf_info(crtdll,
-		 "CRTDLL_fread got %c 0x%02x ret %d\n",
-		   (isalpha(*(unsigned char*)temp))? *(unsigned char*)temp:
-		    ' ',*(unsigned char*)temp, ret);
+    TRACE(crtdll, "got %c 0x%02x ret %d\n",
+		 (isalpha(*(unsigned char*)temp))? *(unsigned char*)temp:
+		 ' ',*(unsigned char*)temp, ret);
     if (*(unsigned char*)temp != 0xd) { /* skip CR */
       temp++;
       i++;
     }
     else
-      dprintf_info(crtdll, "CRTDLL_fread skipping ^M\n");
+      TRACE(crtdll, "skipping ^M\n");
   }
-  dprintf_info(crtdll,
-		 "CRTDLL_fread 0x%08x items of size %d from file %p to %p\n",
-		 nmemb,size,file,ptr,);
+  TRACE(crtdll, "0x%08x items of size %d from file %p to %p\n",
+	       nmemb,size,file,ptr,);
   if(i!=nmemb)
-    dprintf_warn(crtdll, " failed!\n");
+    WARN(crtdll, " failed!\n");
 
   return i;
 #else
     
   ret=fread(ptr,size,nmemb,file);
-  dprintf_info(crtdll,
-	       "CRTDLL_fread 0x%08x items of size %d from file %p to %p\n",
+  TRACE(crtdll, "0x%08x items of size %d from file %p to %p\n",
 	       nmemb,size,file,ptr);
   if(ret!=nmemb)
-    dprintf_warn(crtdll, " failed!\n");
+    WARN(crtdll, " failed!\n");
 
   return ret;
 #endif
@@ -301,13 +294,12 @@
   long ret;
 
   ret=fseek(stream,offset,whence);
-  dprintf_info(crtdll,
-		 "CRTDLL_fseek file %p to 0x%08lx pos %s\n",
-		 stream,offset,(whence==SEEK_SET)?"SEEK_SET":
-		 (whence==SEEK_CUR)?"SEEK_CUR":
-		 (whence==SEEK_END)?"SEEK_END":"UNKNOWN");
+  TRACE(crtdll, "file %p to 0x%08lx pos %s\n",
+	       stream,offset,(whence==SEEK_SET)?"SEEK_SET":
+	       (whence==SEEK_CUR)?"SEEK_CUR":
+	       (whence==SEEK_END)?"SEEK_END":"UNKNOWN");
   if(ret)
-    dprintf_warn(crtdll, " failed!\n");
+    WARN(crtdll, " failed!\n");
 
   return ret;
 }
@@ -320,9 +312,8 @@
   long ret;
 
   ret=ftell(stream);
-  dprintf_info(crtdll,
-		 "CRTDLL_ftell file %p at 0x%08lx\n",
-		 stream,ret);
+  TRACE(crtdll, "file %p at 0x%08lx\n",
+	       stream,ret);
   return ret;
 }
   
@@ -334,11 +325,10 @@
   size_t ret;
 
   ret=fwrite(ptr,size,nmemb,file);
-  dprintf_info(crtdll,
-		 "CRTDLL_fwrite 0x%08x items of size %d from %p to file %p\n",
-		 nmemb,size,ptr,file);
+  TRACE(crtdll, "0x%08x items of size %d from %p to file %p\n",
+	       nmemb,size,ptr,file);
   if(ret!=nmemb)
-    dprintf_warn(crtdll, " Failed!\n");
+    WARN(crtdll, " Failed!\n");
 
   return ret;
 }
@@ -348,9 +338,7 @@
  */
 INT32 __cdecl CRTDLL_setbuf(LPVOID file, LPSTR buf)
 {
-  dprintf_info(crtdll,
-		 "CRTDLL_setbuf(file %p buf %p)\n",
-		 file,buf);
+  TRACE(crtdll, "(file %p buf %p)\n", file, buf);
   /* this doesn't work:"void value not ignored as it ought to be" 
   return setbuf(file,buf); 
   */
@@ -381,9 +369,8 @@
 	default:
 	  return (-1);
 	}
-	dprintf_info(crtdll,
-		       "CRTDLL_open_osfhandle(handle %08lx,flags %d) return %d\n",
-		       osfhandle,flags,handle);
+	TRACE(crtdll, "(handle %08lx,flags %d) return %d\n",
+		     osfhandle,flags,handle);
 	return handle;
 	
 }
@@ -455,7 +442,7 @@
  */
 BOOL32 __cdecl CRTDLL__isatty(DWORD x)
 {
-	dprintf_info(crtdll,"CRTDLL__isatty(%ld)\n",x);
+	TRACE(crtdll,"(%ld)\n",x);
 	return TRUE;
 }
 
@@ -472,7 +459,7 @@
 	  len = (UINT32)write(fd,buf,(LONG)count);
 	else
 	  len = _lwrite32(fd,buf,count);
-	dprintf_info(crtdll,"CRTDLL_write %d/%d byte to dfh %d from %p,\n",
+	TRACE(crtdll,"%d/%d byte to dfh %d from %p,\n",
 		       len,count,fd,buf);
 	return len;
 }
@@ -492,7 +479,7 @@
  */
 void __cdecl CRTDLL__cexit(INT32 ret)
 {
-        dprintf_info(crtdll,"CRTDLL__cexit(%d)\n",ret);
+        TRACE(crtdll,"(%d)\n",ret);
 	ExitProcess(ret);
 }
 
@@ -502,7 +489,7 @@
  */
 void __cdecl CRTDLL_exit(DWORD ret)
 {
-        dprintf_info(crtdll,"CRTDLL_exit(%ld)\n",ret);
+        TRACE(crtdll,"(%ld)\n",ret);
 	ExitProcess(ret);
 }
 
@@ -512,7 +499,7 @@
  */
 INT32 __cdecl CRTDLL__abnormal_termination(void)
 {
-        dprintf_info(crtdll,"CRTDLL__abnormal_termination\n");
+        TRACE(crtdll,"(void)\n");
 	return 0;
 }
 
@@ -525,9 +512,9 @@
     int ret;
 
     ret = fflush(stream);
-    dprintf_info(crtdll,"CRTDLL_fflush %p returnd %d\n",stream,ret);
+    TRACE(crtdll,"%p returnd %d\n",stream,ret);
     if(ret)
-      dprintf_warn(crtdll, " Failed!\n");
+      WARN(crtdll, " Failed!\n");
 
     return ret;
 }
@@ -543,7 +530,7 @@
    * windows95's ftp.exe.
    */
    ret = gets(buf);
-   dprintf_info(crtdll,"CRTDLL_gets got %s\n",ret);
+   TRACE(crtdll,"got %s\n",ret);
    return ret;
 }
 
@@ -571,8 +558,7 @@
  */
 INT32 __cdecl CRTDLL_fputc( INT32 c, FILE *stream )
 {
-  dprintf_info(crtdll,
-		 "CRTDLL_fputc %c to file %p\n",c,stream);
+    TRACE(crtdll, "%c to file %p\n",c,stream);
     return fputc(c,stream);
 }
 
@@ -582,8 +568,7 @@
  */
 INT32 __cdecl CRTDLL_fputs( LPCSTR s, FILE *stream )
 {
-  dprintf_info(crtdll,
-		 "CRTDLL_fputs %s to file %p\n",s,stream);
+    TRACE(crtdll, "%s to file %p\n",s,stream);
     return fputs(s,stream);
 }
 
@@ -593,8 +578,7 @@
  */
 INT32 __cdecl CRTDLL_puts(LPCSTR s)
 {
-  dprintf_info(crtdll,
-		 "CRTDLL_fputs %s \n",s);
+    TRACE(crtdll, "%s \n",s);
     return puts(s);
 }
 
@@ -604,8 +588,7 @@
  */
 INT32 __cdecl CRTDLL_putc(INT32 c, FILE *stream)
 {
-  dprintf_info(crtdll,
-		 "CRTDLL_putc %c to file %p\n",c,stream);
+    TRACE(crtdll, " %c to file %p\n",c,stream);
     return fputc(c,stream);
 }
 /*********************************************************************
@@ -614,8 +597,7 @@
 INT32 __cdecl CRTDLL_fgetc( FILE *stream )
 {
   int ret= fgetc(stream);
-  dprintf_info(crtdll,
-		 "CRTDLL_fgetc got %d\n",ret);
+  TRACE(crtdll, "got %d\n",ret);
   return ret;
 }
 
@@ -626,8 +608,7 @@
 INT32 __cdecl CRTDLL_getc( FILE *stream )
 {
   int ret= fgetc(stream);
-  dprintf_info(crtdll,
-		 "CRTDLL_getc got %d\n",ret);
+  TRACE(crtdll, "got %d\n",ret);
   return ret;
 }
 
@@ -638,8 +619,7 @@
 {
    unsigned int ret = (x >> shift)|( x >>((sizeof(x))-shift));
 
-   dprintf_info(crtdll,
-		  "CRTDLL_rotl got 0x%08x rot %d ret 0x%08x\n",
+   TRACE(crtdll, "got 0x%08x rot %d ret 0x%08x\n",
 		  x,shift,ret);
    return ret;
     
@@ -651,8 +631,7 @@
 {
    unsigned long ret = (x >> shift)|( x >>((sizeof(x))-shift));
 
-   dprintf_info(crtdll,
-		  "CRTDLL_lrotl got 0x%08lx rot %d ret 0x%08lx\n",
+   TRACE(crtdll, "got 0x%08lx rot %d ret 0x%08lx\n",
 		  x,shift,ret);
    return ret;
     
@@ -676,11 +655,10 @@
       *control_M='\n';
       *(control_M+1)=0;
     }
-  dprintf_info(crtdll,
-		 "CRTDLL_fgets got %s for %d chars from file %p\n",
+  TRACE(crtdll, "got %s for %d chars from file %p\n",
 		 s,size,stream);
   if(ret)
-    dprintf_warn(crtdll, " Failed!\n");
+    WARN(crtdll, " Failed!\n");
 
   return ret;
 }
@@ -736,7 +714,7 @@
  */
 unsigned char* __cdecl CRTDLL__mbscpy(unsigned char *x,unsigned char *y)
 {
-    dprintf_info(crtdll,"CRTDLL_mbscpy %s and %s\n",x,y);
+    TRACE(crtdll,"CRTDLL_mbscpy %s and %s\n",x,y);
     return strcpy(x,y);
 }
 
@@ -777,13 +755,13 @@
 {
   unsigned char *y =x;
   
-  dprintf_info(crtdll, "CRTDLL_strlwr got %s\n", x);
+  TRACE(crtdll, "CRTDLL_strlwr got %s\n", x);
   while (*y) {
     if ((*y > 0x40) && (*y< 0x5b))
       *y = *y + 0x20;
     y++;
   }
-  dprintf_info(crtdll, "   returned %s\n", x);
+  TRACE(crtdll, "   returned %s\n", x);
 		 
   return x;
 }
@@ -810,7 +788,7 @@
   }
   /* If buffer too short, exit.  */
   if (i > SYSBUF_LENGTH) {
-    dprintf_info(crtdll,"_system buffer to small\n");
+    TRACE(crtdll,"_system buffer to small\n");
     return 127;
   }
   
@@ -827,8 +805,7 @@
   }
   *bp++ = '"';
   *bp = 0;
-  dprintf_info(crtdll,
-		 "_system got \"%s\", executing \"%s\"\n",x,buffer);
+  TRACE(crtdll, "_system got '%s', executing '%s'\n",x,buffer);
 
   return system(buffer);
 }
@@ -881,7 +858,7 @@
  */
 VOID __cdecl CRTDLL_longjmp(jmp_buf env, int val)
 {
-    dprintf_fixme(crtdll,"CRTDLL_longjmp semistup, expect crash\n");
+    FIXME(crtdll,"CRTDLL_longjmp semistup, expect crash\n");
     return longjmp(env, val);
 }
 
@@ -970,11 +947,11 @@
       fclose(stream);
       ret = _lclose32( dos_handle);
     }
-    dprintf_info(crtdll,"CRTDLL_fclose(%p) ufh %d dfh %d\n",
+    TRACE(crtdll,"(%p) ufh %d dfh %d\n",
 		   stream,unix_handle,dos_handle);
 
     if(ret)
-      dprintf_warn(crtdll, " Failed!\n");
+      WARN(crtdll, " Failed!\n");
 
     return ret;
 }
@@ -988,15 +965,15 @@
     DOS_FULL_NAME full_name;
 
     if (!DOSFS_GetFullName( pathname, FALSE, &full_name )) {
-      dprintf_warn(crtdll, "CRTDLL_unlink file %s bad name\n",pathname);
+      WARN(crtdll, "CRTDLL_unlink file %s bad name\n",pathname);
       return EOF;
     }
   
     ret=unlink(full_name.long_name);
-    dprintf_info(crtdll,"CRTDLL_unlink(%s unix %s)\n",
+    TRACE(crtdll,"(%s unix %s)\n",
 		   pathname,full_name.long_name);
     if(ret)
-      dprintf_warn(crtdll, " Failed!\n");
+      WARN(crtdll, " Failed!\n");
 
     return ret;
 }
@@ -1038,13 +1015,13 @@
 
     if (!DOSFS_GetFullName( filename, TRUE, &full_name ))
     {
-      dprintf_warn(crtdll, "CRTDLL__stat filename %s bad name\n",filename);
+      WARN(crtdll, "CRTDLL__stat filename %s bad name\n",filename);
       return -1;
     }
     ret=stat(full_name.long_name,&mystat);
-    dprintf_info(crtdll,"CRTDLL__stat %s\n", filename);
+    TRACE(crtdll,"CRTDLL__stat %s\n", filename);
     if(ret) 
-      dprintf_warn(crtdll, " Failed!\n");
+      WARN(crtdll, " Failed!\n");
 
     /* FIXME: should check what Windows returns */
 
@@ -1083,11 +1060,11 @@
     if (flags & 0x0200 ) wineflags |= O_TRUNC;
     if (flags & 0x0400 ) wineflags |= O_EXCL;
     if (flags & 0xf0f4 ) 
-      dprintf_info(crtdll,"CRTDLL_open file unsupported flags 0x%04x\n",flags);
+      TRACE(crtdll,"CRTDLL_open file unsupported flags 0x%04x\n",flags);
     /* End Fixme */
 
     ret = FILE_Open(path,wineflags);
-    dprintf_info(crtdll,"CRTDLL_open file %s mode 0x%04x (lccmode 0x%04x) got dfh %d\n",
+    TRACE(crtdll,"CRTDLL_open file %s mode 0x%04x (lccmode 0x%04x) got dfh %d\n",
 		   path,wineflags,flags,ret);
     return ret;
 }
@@ -1099,9 +1076,9 @@
 {
     int ret=_lclose32(fd);
 
-    dprintf_info(crtdll,"CRTDLL_close(%d)\n",fd);
+    TRACE(crtdll,"(%d)\n",fd);
     if(ret)
-      dprintf_warn(crtdll, " Failed!\n");
+      WARN(crtdll, " Failed!\n");
 
     return ret;
 }
@@ -1114,7 +1091,7 @@
     int ret;
     
     ret=feof(stream);
-    dprintf_info(crtdll,"CRTDLL_feof(%p) %s\n",stream,(ret)?"true":"false");
+    TRACE(crtdll,"(%p) %s\n",stream,(ret)?"true":"false");
     return ret;
 }
 
@@ -1360,9 +1337,9 @@
 #define O_TEXT     0x4000
 #define O_BINARY   0x8000
 
-	dprintf_fixme(crtdll, "CRTDLL._setmode on fhandle %d mode %s, STUB.\n",
+	FIXME(crtdll, "on fhandle %d mode %s, STUB.\n",
 		      fh,(mode=O_TEXT)?"O_TEXT":
-		                        (mode=O_BINARY)?"O_BINARY":"UNKNOWN");
+		      (mode=O_BINARY)?"O_BINARY":"UNKNOWN");
 	return -1;
 }
 
@@ -1392,7 +1369,7 @@
     else if (!(*mb))
       ret =0;
       
-    dprintf_info(crtdll,"CRTDLL_mlen %s for max %d bytes ret %d\n",mb,size,ret);
+    TRACE(crtdll,"CRTDLL_mlen %s for max %d bytes ret %d\n",mb,size,ret);
 
     return ret;
 }
@@ -1419,7 +1396,7 @@
     p++;
     ret = (p -wcs);
           
-    dprintf_info(crtdll,"CRTDLL_mbstowcs %s for %d chars put %d wchars\n",
+    TRACE(crtdll,"CRTDLL_mbstowcs %s for %d chars put %d wchars\n",
 		   mbs,size,ret);
     return ret;
 }
@@ -1447,7 +1424,7 @@
      else
        ret = -1;
    
-   dprintf_info(crtdll,"CRTDLL_mbtowc %s for %d chars\n",mb,size);
+   TRACE(crtdll,"CRTDLL_mbtowc %s for %d chars\n",mb,size);
          
    return ret;
 }
@@ -1508,7 +1485,7 @@
   }
   if (!DOSFS_GetFullName( name, FALSE, &full_name )) return NULL;
   lstrcpyn32A(buf,full_name.short_name,size);
-  dprintf_info(crtdll,"CRTDLL_fullpath got %s\n",buf);
+  TRACE(crtdll,"CRTDLL_fullpath got %s\n",buf);
   return buf;
 }
 
@@ -1524,7 +1501,7 @@
      */
   char * drivechar,*dirchar,*namechar;
 
-  dprintf_info(crtdll,"CRTDLL__splitpath got %s\n",path);
+  TRACE(crtdll,"CRTDLL__splitpath got %s\n",path);
 
   drivechar  = strchr(path,':');
   dirchar    = strrchr(path,'/');
@@ -1568,7 +1545,7 @@
 	}
     }
 
-  dprintf_info(crtdll,"CRTDLL__splitpath found %s %s %s %s\n",drive,directory,filename,extension);
+  TRACE(crtdll,"CRTDLL__splitpath found %s %s %s %s\n",drive,directory,filename,extension);
   
 }
 
@@ -1598,7 +1575,7 @@
   if (len > size)
     {
       /* set error to ERANGE */
-      dprintf_info(crtdll,"CRTDLL_getcwd buffer to small\n");
+      TRACE(crtdll,"CRTDLL_getcwd buffer to small\n");
       return NULL;
     }
   return buf;
@@ -1640,28 +1617,25 @@
      DOS_FULL_NAME tempname;
      
      if ((ret = tempnam(dir,prefix))==NULL) {
-       dprintf_warn(crtdll, "Unable to get unique filename\n");
+       WARN(crtdll, "Unable to get unique filename\n");
        return NULL;
      }
      if (!DOSFS_GetFullName(ret,FALSE,&tempname))
      {
-       dprintf_info(crtdll,
-		      "CRTDLL_tempnam Wrong path?\n");
+       TRACE(crtdll, "Wrong path?\n");
        return NULL;
      }
      free(ret);
      if ((ret = CRTDLL_malloc(strlen(tempname.short_name)+1)) == NULL) {
-	 dprintf_warn(crtdll,
-			"CRTDLL_tempnam CRTDL_malloc for shortname failed\n");
+	 WARN(crtdll, "CRTDL_malloc for shortname failed\n");
 	 return NULL;
      }
      if ((ret = strcpy(ret,tempname.short_name)) == NULL) { 
-       dprintf_warn(crtdll,
-		      "CRTDLL_tempnam Malloc for shortname failed\n");
+       WARN(crtdll, "Malloc for shortname failed\n");
        return NULL;
      }
      
-     dprintf_info(crtdll,"CRTDLL_tempnam dir %s prefix %s got %s\n",
+     TRACE(crtdll,"dir %s prefix %s got %s\n",
 		    dir,prefix,ret);
      return ret;
 
@@ -1677,19 +1651,18 @@
      char *ret;
 
      if ((ret =tmpnam(s))== NULL) {
-       dprintf_warn(crtdll, "Unable to get unique filename\n");
+       WARN(crtdll, "Unable to get unique filename\n");
        return NULL;
      }
      if (!DOSFS_GetFullName(ret,FALSE,&CRTDLL_tmpname))
      {
-       dprintf_info(crtdll,
-		      "CRTDLL_tmpnam Wrong path?\n");
+       TRACE(crtdll, "Wrong path?\n");
        return NULL;
      }
      strcat(CRTDLL_tmpname.short_name,".");
-     dprintf_info(crtdll,"CRTDLL_tmpnam for buf %p got %s\n",
+     TRACE(crtdll,"for buf %p got %s\n",
 		    s,CRTDLL_tmpname.short_name);
-     dprintf_info(crtdll,"CRTDLL_tmpnam long got %s\n",
+     TRACE(crtdll,"long got %s\n",
 		    CRTDLL_tmpname.long_name);
      if ( s != NULL) 
        return strcpy(s,CRTDLL_tmpname.short_name);
@@ -1714,7 +1687,7 @@
  */
 VOID __cdecl CRTDLL_signal(int sig, sig_handler_type ptr)
 {
-    dprintf_fixme(crtdll, "CRTDLL_signal %d %p: STUB!\n", sig, ptr);
+    FIXME(crtdll, "(%d %p): STUB!\n", sig, ptr);
 }
 
 /*********************************************************************
@@ -1728,6 +1701,6 @@
  */
 VOID __cdecl CRTDLL__sleep(unsigned long timeout) 
 {
-  dprintf_info(crtdll,"CRTDLL__sleep for %ld milliseconds\n",timeout);
+  TRACE(crtdll,"CRTDLL__sleep for %ld milliseconds\n",timeout);
   Sleep((timeout)?timeout:1);
 }
diff --git a/misc/ddeml.c b/misc/ddeml.c
index 4367c53..fb94286 100644
--- a/misc/ddeml.c
+++ b/misc/ddeml.c
@@ -18,7 +18,7 @@
 UINT16 WINAPI DdeInitialize16( LPDWORD pidInst, PFNCALLBACK16 pfnCallback,
                                DWORD afCmd, DWORD ulRes)
 {
-    fprintf( stdnimp, "DdeInitialize16: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -29,7 +29,7 @@
 UINT32 WINAPI DdeInitialize32A( LPDWORD pidInst, PFNCALLBACK32 pfnCallback,
                                 DWORD afCmd, DWORD ulRes )
 {
-    fprintf( stdnimp, "DdeInitialize32A: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -40,7 +40,7 @@
 UINT32 WINAPI DdeInitialize32W( LPDWORD pidInst, PFNCALLBACK32 pfnCallback,
                                 DWORD afCmd, DWORD ulRes )
 {
-    fprintf( stdnimp, "DdeInitialize32W: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -59,7 +59,7 @@
  */
 BOOL32 WINAPI DdeUninitialize32( DWORD idInst )
 {
-    fprintf( stdnimp, "DdeUninitialize: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return TRUE;
 }
 
@@ -69,7 +69,7 @@
 HCONVLIST WINAPI DdeConnectList( DWORD idInst, HSZ hszService, HSZ hszTopic,
         HCONVLIST hConvList, LPCONVCONTEXT16 pCC )
 {
-    fprintf( stdnimp, "DdeConnectList: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -78,7 +78,7 @@
  */
 HCONV WINAPI DdeQueryNextServer( HCONVLIST hConvList, HCONV hConvPrev )
 {
-    fprintf( stdnimp, "DdeQueryNextServer: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -87,7 +87,7 @@
  */
 BOOL16 WINAPI DdeDisconnectList( HCONVLIST hConvList )
 {
-    fprintf( stdnimp, "DdeDisconnectList: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -97,7 +97,7 @@
 HCONV WINAPI DdeConnect16( DWORD idInst, HSZ hszService, HSZ hszTopic,
                            LPCONVCONTEXT16 pCC )
 {
-    fprintf( stdnimp, "DdeConnect16: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -108,7 +108,7 @@
 HCONV WINAPI DdeConnect32( DWORD idInst, HSZ hszService, HSZ hszTopic,
                            LPCONVCONTEXT32 pCC )
 {
-    fprintf( stdnimp, "DdeConnect32: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -126,7 +126,7 @@
  */
 BOOL16 WINAPI DdeSetUserHandle( HCONV hConv, DWORD id, DWORD hUser )
 {
-    fprintf( stdnimp, "DdeSetUserHandle: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -135,7 +135,7 @@
  */
 HDDEDATA WINAPI DdeCreateDataHandle( DWORD idInst, LPBYTE pSrc, DWORD cb, DWORD cbOff, HSZ hszItem, UINT16 wFmt, UINT16 afCmd )
 {
-    fprintf( stdnimp, "DdeCreateDataHandle: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -144,7 +144,7 @@
  */
 BOOL32 WINAPI DdeDisconnect32( HCONV hConv )
 {
-    fprintf( stdnimp, "DdeDisconnect: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -154,7 +154,7 @@
  */
 HCONV WINAPI DdeReconnect( HCONV hConv )
 {
-    fprintf( stdnimp, "DdeReconnect: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -173,7 +173,7 @@
  */
 HSZ WINAPI DdeCreateStringHandle32A( DWORD idInst, LPCSTR psz, INT32 codepage )
 {
-    fprintf( stdnimp, "DdeCreateStringHandle32A: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -183,7 +183,7 @@
  */
 HSZ WINAPI DdeCreateStringHandle32W( DWORD idInst, LPCWSTR psz, INT32 codepage)
 {
-    fprintf( stdnimp, "DdeCreateStringHandle32W: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -202,7 +202,7 @@
  */
 BOOL32 WINAPI DdeFreeStringHandle32( DWORD idInst, HSZ hsz )
 {
-    fprintf( stdnimp, "DdeFreeStringHandle: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return TRUE;
 }
 
@@ -221,7 +221,7 @@
  */
 BOOL32 WINAPI DdeFreeDataHandle32( HDDEDATA hData )
 {
-    fprintf( stdnimp, "DdeFreeDataHandle: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return TRUE;
 }
 
@@ -240,7 +240,7 @@
  */
 BOOL32 WINAPI DdeKeepStringHandle32( DWORD idInst, HSZ hsz )
 {
-    fprintf( stdnimp, "DdeKeepStringHandle: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return TRUE;
 }
 
@@ -266,7 +266,7 @@
                                         UINT32 wType, DWORD dwTimeout,
                                         LPDWORD pdwResult )
 {
-    fprintf( stdnimp, "DdeClientTransaction: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -276,7 +276,7 @@
 BOOL16 WINAPI DdeAbandonTransaction( DWORD idInst, HCONV hConv, 
                                      DWORD idTransaction )
 {
-    fprintf( stdnimp, "DdeAbandonTransaction: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -285,7 +285,7 @@
  */
 BOOL16 WINAPI DdePostAdvise( DWORD idInst, HSZ hszTopic, HSZ hszItem )
 {
-    fprintf( stdnimp, "DdePostAdvise: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -295,7 +295,7 @@
 HDDEDATA WINAPI DdeAddData( HDDEDATA hData, LPBYTE pSrc, DWORD cb,
                             DWORD cbOff )
 {
-    fprintf( stdnimp, "DdeAddData: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -305,7 +305,7 @@
 DWORD WINAPI DdeGetData( HDDEDATA hData, LPBYTE pDst, DWORD cbMax, 
                          DWORD cbOff )
 {
-    fprintf( stdnimp, "DdeGetData: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -314,7 +314,7 @@
  */
 LPBYTE WINAPI DdeAccessData( HDDEDATA hData, LPDWORD pcbDataSize )
 {
-     fprintf( stdnimp, "DdeAccessData: empty stub\n" );
+     FIXME( ddeml, "empty stub\n" );
      return 0;
 }
 
@@ -323,7 +323,7 @@
  */
 BOOL16 WINAPI DdeUnaccessData( HDDEDATA hData )
 {
-     fprintf( stdnimp, "DdeUnaccessData: empty stub\n" );
+     FIXME( ddeml, "empty stub\n" );
      return 0;
 }
 
@@ -332,7 +332,7 @@
  */
 BOOL16 WINAPI DdeEnableCallback( DWORD idInst, HCONV hConv, UINT16 wCmd )
 {
-     fprintf( stdnimp, "DdeEnableCallback: empty stub\n" );
+     FIXME( ddeml, "empty stub\n" );
      return 0;
 }
 
@@ -352,7 +352,7 @@
 HDDEDATA WINAPI DdeNameService32( DWORD idInst, HSZ hsz1, HSZ hsz2,
                                   UINT32 afCmd )
 {
-    fprintf( stdnimp, "DdeNameService: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -371,7 +371,7 @@
  */
 UINT32 WINAPI DdeGetLastError32( DWORD idInst )
 {
-    fprintf( stdnimp, "DdeGetLastError: empty stub\n" );
+    FIXME( ddeml, "empty stub\n" );
     return 0;
 }
 
@@ -380,7 +380,7 @@
  */
 int WINAPI DdeCmpStringHandles( HSZ hsz1, HSZ hsz2 )
 {
-     fprintf( stdnimp, "DdeCmpStringHandles: empty stub\n" );
+     FIXME( ddeml, "empty stub\n" );
      return 0;
 }
 
diff --git a/misc/imagelist.c b/misc/imagelist.c
new file mode 100644
index 0000000..f212a9c
--- /dev/null
+++ b/misc/imagelist.c
@@ -0,0 +1,647 @@
+/*
+ *  ImageList implementation
+ *
+ *  Copyright 1998 Eric Kohl
+ *
+ *  TODO:
+ *    - Use device independent bitmaps (DIBs) instead of device
+ *      dependent bitmaps (DDBs).
+ *    - Fix image selection (ImageList_Draw).
+ *    - Improve error checking.
+ *    - Add missing functions.
+ *    - Many many other things. (undocumented functions)
+ */
+
+/* This must be defined because the HIMAGELIST type is just a pointer
+ * to the _IMAGELIST data structure. But MS does not want us to know
+ * anything about its contents. Applications just see a pointer to
+ * a struct without any content. It's just to keep compatibility.
+ */
+#define __WINE_IMAGELIST_C
+ 
+/* This must be defined until "GetIconInfo" is implemented completely.
+ * To do that the Cursor and Icon code in objects/cursoricon.c must
+ * be rewritten.
+ */
+#define __GET_ICON_INFO_HACK__ 
+ 
+#include <stdlib.h>
+#include "windows.h"
+#include "imagelist.h"
+#include "commctrl.h"
+#include "debug.h"
+
+#ifdef __GET_ICON_INFO_HACK__
+#include "bitmap.h"
+#endif
+
+
+static void
+IMAGELIST_GrowBitmaps (HIMAGELIST himl, INT32 nImageCount)
+{
+    HDC32     hdcScreen, hdcImageList, hdcBitmap;
+    HBITMAP32 hbmNewBitmap;
+    INT32     nNewWidth;
+
+    /* no space left for new Image(s) ==> create new Bitmap(s) */
+    printf ("IMAGELIST_GrowBitmaps: Create grown bitmaps!!\n");
+
+    nNewWidth = (himl->cCurImage + nImageCount + himl->cGrow) * himl->cx;
+
+    hdcScreen = GetDC32 (GetDesktopWindow32 ());
+    hdcImageList = CreateCompatibleDC32 (hdcScreen);
+    hdcBitmap = CreateCompatibleDC32 (hdcScreen);
+    ReleaseDC32 (hdcScreen, GetDesktopWindow32 ());
+
+    hbmNewBitmap =
+        CreateCompatibleBitmap32 (hdcImageList, nNewWidth, himl->cy);
+
+    SelectObject32 (hdcImageList, himl->hbmImage);
+    SelectObject32 (hdcBitmap, hbmNewBitmap);
+    BitBlt32 (hdcBitmap, 0, 0, himl->cCurImage * himl->cx, himl->cy,
+              hdcImageList, 0, 0, SRCCOPY);
+
+    DeleteObject32 (himl->hbmImage);
+    himl->hbmImage = hbmNewBitmap;
+
+    if (himl->hbmMask) {
+        hbmNewBitmap = 
+            CreateCompatibleBitmap32 (hdcImageList, nNewWidth, himl->cy); 
+        SelectObject32 (hdcImageList, himl->hbmMask);
+        SelectObject32 (hdcBitmap, hbmNewBitmap);
+        BitBlt32 (hdcBitmap, 0, 0, himl->cCurImage * himl->cx, himl->cy,
+                  hdcImageList, 0, 0, SRCCOPY);
+        DeleteObject32 (himl->hbmMask);
+        himl->hbmMask = hbmNewBitmap;
+    }
+
+    DeleteDC32 (hdcImageList);
+    DeleteDC32 (hdcBitmap);
+}
+
+
+INT32 WINAPI
+ImageList_Add (HIMAGELIST himl, HBITMAP32 hbmImage, HBITMAP32 hbmMask)
+{
+    HDC32    hdcImageList, hdcImage, hdcMask;
+    INT32    nFirstIndex, nImageCount;
+    INT32    nStartX, nRunX, nRunY;
+    COLORREF clrColor;
+    BITMAP32 bmp;
+
+    GetObject32A (hbmImage, sizeof(BITMAP32), (LPVOID)&bmp);
+    nImageCount = bmp.bmWidth / himl->cx;
+
+    if (himl->cCurImage + nImageCount >= himl->cMaxImage)
+        IMAGELIST_GrowBitmaps (himl, nImageCount);
+
+    hdcImageList = CreateCompatibleDC32 (0);
+    hdcImage = CreateCompatibleDC32 (0);
+
+    SelectObject32 (hdcImageList, himl->hbmImage);
+    SelectObject32 (hdcImage, hbmImage);
+
+    BitBlt32 (hdcImageList, himl->cCurImage * himl->cx, 0,
+              bmp.bmWidth, himl->cy, hdcImage, 0, 0, SRCCOPY);
+          
+    if (himl->hbmMask) {
+        if (hbmMask) {
+            SelectObject32 (hdcImageList, himl->hbmMask);
+            SelectObject32 (hdcImage, hbmMask);
+            BitBlt32 (hdcImageList, himl->cCurImage * himl->cx, 0,
+                      bmp.bmWidth, himl->cy, hdcImage, 0, 0, SRCCOPY);
+        }
+        else {
+            /* create mask from the imagelist's background color */
+            hdcMask = CreateCompatibleDC32 (0);
+            SelectObject32 (hdcMask, himl->hbmMask);
+            nStartX = himl->cCurImage * himl->cx;
+            for (nRunY = 0; nRunY < himl->cy; nRunY++) {
+                for (nRunX = 0; nRunX < bmp.bmWidth; nRunX++) {
+                    clrColor = GetPixel32 (hdcImage, nRunX, nRunY);
+                    if (clrColor == himl->clrBk) {
+                        SetPixel32 (hdcImageList, nStartX + nRunX, nRunY, 
+                                    RGB(0, 0, 0));
+                        SetPixel32 (hdcMask, nStartX + nRunX, nRunY, 
+                                    RGB(255, 255, 255));
+                    }
+                    else
+                        SetPixel32 (hdcMask, nStartX + nRunX, nRunY, 
+                                    RGB(0, 0, 0));        
+                }
+            }
+            DeleteDC32 (hdcMask);
+        }
+    }
+
+    DeleteDC32 (hdcImageList);
+    DeleteDC32 (hdcImage);
+
+    nFirstIndex = himl->cCurImage;
+    himl->cCurImage += nImageCount;
+
+    return (nFirstIndex);
+}
+
+
+INT32 WINAPI
+ImageList_AddMasked (HIMAGELIST himl, HBITMAP32 hbmImage, COLORREF crMask)
+{
+    HDC32    hdcImageList, hdcImage, hdcMask;
+    INT32    nIndex, nImageCount;
+    BITMAP32 bmp;
+    INT32    nStartX, nRunX, nRunY;
+    COLORREF crColor;
+
+    GetObject32A (hbmImage, sizeof(BITMAP32), &bmp);
+    nImageCount = bmp.bmWidth / himl->cx;
+
+    if (himl->cCurImage + nImageCount >= himl->cMaxImage)
+        IMAGELIST_GrowBitmaps (himl, nImageCount);
+
+    nIndex = himl->cCurImage;
+    himl->cCurImage += nImageCount;
+
+    hdcImageList = CreateCompatibleDC32 (0);
+    hdcImage = CreateCompatibleDC32 (0);
+
+    SelectObject32 (hdcImageList, himl->hbmImage);
+    SelectObject32 (hdcImage, hbmImage);
+    BitBlt32 (hdcImageList, nIndex * himl->cx, 0,
+              bmp.bmWidth, himl->cy, hdcImage, 0, 0, SRCCOPY);
+
+    if (himl->hbmMask) {
+        /* create Mask */
+        hdcMask = CreateCompatibleDC32 (0);
+        SelectObject32 (hdcMask, himl->hbmMask);
+        nStartX = nIndex * himl->cx;
+        for (nRunY = 0; nRunY < himl->cy; nRunY++) {
+            for (nRunX = 0; nRunX < bmp.bmWidth; nRunX++) {
+                crColor = GetPixel32 (hdcImage, nRunX, nRunY);
+                if (crColor == crMask) {
+                    SetPixel32 (hdcImageList, nStartX + nRunX, nRunY,
+                                RGB(0, 0, 0));
+                    SetPixel32 (hdcMask, nStartX + nRunX, nRunY,
+                                RGB(255, 255, 255));
+                }
+                else
+                    SetPixel32 (hdcMask, nStartX + nRunX, nRunY, RGB(0, 0, 0));
+            }
+        }
+        DeleteDC32 (hdcMask);
+    }
+
+    DeleteDC32 (hdcImageList);
+    DeleteDC32 (hdcImage);
+  
+    return (nIndex);
+}
+
+
+HIMAGELIST WINAPI
+ImageList_Create (INT32 cx, INT32 cy, UINT32 flags, INT32 cInitial, INT32 cGrow)
+{
+    HIMAGELIST himl;
+    HANDLE32 hHeap;
+    HDC32 hdcDesktop;
+    HWND32 hwndDesktop;
+
+    hHeap = GetProcessHeap ();
+    himl = (HIMAGELIST) HeapAlloc (hHeap, 0, sizeof(struct _IMAGELIST));
+    if (!himl)
+        return (0);
+    himl->hHeap = hHeap;
+    himl->cx = cx;
+    himl->cy = cy;
+    himl->flags = flags;
+    himl->cMaxImage = cInitial + cGrow;
+    himl->cGrow = cGrow;
+    himl->cCurImage = 0;
+    himl->clrBk = CLR_NONE;  /* ??? or CLR_DEFAULT */
+    himl->nOvlIdx[0] = -1;
+    himl->nOvlIdx[1] = -1;
+    himl->nOvlIdx[2] = -1;
+    himl->nOvlIdx[3] = -1;
+
+    hwndDesktop = GetDesktopWindow32();
+    hdcDesktop = GetDC32 (hwndDesktop);
+    
+    himl->hbmImage =
+        CreateCompatibleBitmap32 (hdcDesktop, himl->cx * himl->cMaxImage, 
+                                  himl->cy);
+    if (himl->flags & ILC_MASK)
+        himl->hbmMask = 
+            CreateCompatibleBitmap32 (hdcDesktop, himl->cx * himl->cMaxImage, 
+                                      himl->cy); 
+    else
+        himl->hbmMask = 0;
+
+    ReleaseDC32 (hwndDesktop, hdcDesktop);
+    
+    return (himl);    
+}
+
+
+BOOL32 WINAPI
+ImageList_Destroy (HIMAGELIST himl)
+{
+    if (himl->hbmImage)
+        DeleteObject32 (himl->hbmImage);
+    if (himl->hbmMask)
+        DeleteObject32 (himl->hbmMask);
+        
+    HeapFree (himl->hHeap, 0, (LPVOID)himl);
+    return (TRUE);
+}
+
+
+
+BOOL32 WINAPI
+ImageList_Draw (HIMAGELIST himl, INT32 i, HDC32 hdc, 
+                INT32 x, INT32 y, UINT32 fStyle)
+{
+    HDC32     hdcImageList,hdcMask;
+    HBITMAP32 hbmMask;
+    HBRUSH32 hBrush, hOldBrush;
+    INT32 nOvlIdx;
+
+    hdcImageList = CreateCompatibleDC32 (0);
+  
+    if (himl->hbmMask) {  
+        SelectObject32 (hdcImageList, himl->hbmMask);
+        BitBlt32 (hdc, x, y, himl->cx, himl->cy, hdcImageList,
+                  himl->cx * i, 0, SRCAND);  
+    }  
+
+    SelectObject32 (hdcImageList, himl->hbmImage);
+
+    BitBlt32 (hdc, x, y, himl->cx, himl->cy, hdcImageList,
+              himl->cx * i, 0, SRCPAINT);
+
+    /* Draw overlay image */
+    if (fStyle & 0x0700) {
+        nOvlIdx = (fStyle & 0x0700) >> 8;
+        if ((nOvlIdx >= 1) && (nOvlIdx <= 4)) {
+            nOvlIdx = himl->nOvlIdx[nOvlIdx - 1];
+            if ((nOvlIdx >= 0) && (nOvlIdx <= himl->cCurImage)) {
+
+                if (himl->hbmMask) {  
+                    SelectObject32 (hdcImageList, himl->hbmMask);
+                    BitBlt32 (hdc, x, y, himl->cx, himl->cy, hdcImageList,
+                              himl->cx * nOvlIdx, 0, SRCAND);  
+                }  
+                SelectObject32 (hdcImageList, himl->hbmImage);
+                BitBlt32 (hdc, x, y, himl->cx, himl->cy, hdcImageList,
+                          himl->cx * nOvlIdx, 0, SRCPAINT);
+
+            }
+        }
+    }
+
+    DeleteDC32 (hdcImageList);
+  
+    return (TRUE);
+}
+
+
+
+COLORREF WINAPI
+ImageList_GetBkColor (HIMAGELIST himl)
+{
+    return (himl->clrBk);
+}
+
+
+HICON32 WINAPI
+ImageList_GetIcon (HIMAGELIST himl, INT32 i, UINT32 flags)
+{
+
+
+    return (0);
+}
+
+
+BOOL32 WINAPI
+ImageList_GetIconSize (HIMAGELIST himl, INT32 *cx, INT32 *cy)
+{
+    *cx = himl->cx;
+    *cy = himl->cy;
+    return (TRUE);
+}
+
+
+INT32 WINAPI
+ImageList_GetImageCount (HIMAGELIST himl)
+{
+    return (himl->cCurImage);
+}
+
+
+BOOL32 WINAPI
+ImageList_GetImageInfo (HIMAGELIST himl, INT32 i, IMAGEINFO *pImageInfo)
+{
+    pImageInfo->hbmImage = himl->hbmImage;
+    pImageInfo->hbmMask  = himl->hbmMask;
+    
+    pImageInfo->rcImage.top    = 0;
+    pImageInfo->rcImage.bottom = himl->cy;
+    pImageInfo->rcImage.left   = i * himl->cx;
+    pImageInfo->rcImage.right  = (i+1) * himl->cx;
+    
+    return (TRUE);
+}
+
+
+HIMAGELIST WINAPI
+ImageList_LoadImage32A (HINSTANCE32 hi, LPCSTR lpbmp, INT32 cx, INT32 cGrow, 
+                        COLORREF clrMask, UINT32 uType, UINT32 uFlags)
+{
+    HIMAGELIST himl = NULL;
+    HANDLE32   handle;
+    INT32      nImageCount;
+
+    handle = LoadImage32A (hi, lpbmp, uType, 0, 0, uFlags);
+
+    if (uType == IMAGE_BITMAP) {
+        BITMAP32 bmp;
+        GetObject32A (handle, sizeof(BITMAP32), &bmp);
+        nImageCount = bmp.bmWidth / cx;
+
+        himl = ImageList_Create (cx, bmp.bmHeight, ILC_MASK | ILC_COLOR,
+                                 nImageCount, cGrow);
+        ImageList_AddMasked (himl, (HBITMAP32)handle, clrMask);
+    }
+    else if ((uType == IMAGE_ICON) || (uType == IMAGE_CURSOR)) {
+#ifdef __GET_ICON_INFO_HACK__
+        HBITMAP32 hbmImage;
+        HBITMAP32 hbmMask;
+        CURSORICONINFO *ptr;
+
+        if (!(ptr = (CURSORICONINFO *)GlobalLock16(handle))) return (NULL);
+        hbmMask  = CreateBitmap32 (ptr->nWidth, ptr->nHeight, 1, 1, 
+                                   (char *)(ptr + 1));
+        hbmImage = CreateBitmap32 (ptr->nWidth, ptr->nHeight, ptr->bPlanes,
+                                   ptr->bBitsPerPixel,
+                                   (char *)(ptr + 1) + ptr->nHeight * 
+                                   BITMAP_WIDTH_BYTES(ptr->nWidth, 1));
+        himl = ImageList_Create (ptr->nWidth, ptr->nHeight,
+                                 ILC_MASK | ILC_COLOR, 1, cGrow);
+        ImageList_Add (himl, hbmImage, hbmMask);
+        DeleteObject32 (hbmImage);
+        DeleteObject32 (hbmMask);
+        GlobalUnlock16 (handle);
+#else
+        ICONINFO32 ii;
+        BITMAP32 bmp;
+
+        GetIconInfo (hIcon, &ii);
+        GetObject32A (ii->hbmMask, sizeof(BITMAP32), (LPVOID)&bmp);
+        himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight, 
+                                 ILC_MASK | ILC_COLOR, 1, cGrow);
+        ImageList_Add (himl, ii->hbmColor, ii->hbmMask);
+#endif
+    }
+
+    DeleteObject32 (handle);
+    
+    return (himl);
+}
+
+
+HIMAGELIST WINAPI
+ImageList_LoadImage32W (HINSTANCE32 hi, LPCWSTR lpbmp, INT32 cx, INT32 cGrow, 
+                        COLORREF clrMask, UINT32 uType, UINT32 uFlags)
+{
+    HIMAGELIST himl = NULL;
+    HANDLE32   handle;
+    INT32      nImageCount;
+
+    handle = LoadImage32W (hi, lpbmp, uType, 0, 0, uFlags);
+
+    if (uType == IMAGE_BITMAP) {
+        BITMAP32 bmp;
+        GetObject32A (handle, sizeof(BITMAP32), &bmp);
+        nImageCount = bmp.bmWidth / cx;
+
+        himl = ImageList_Create (cx, bmp.bmHeight, ILC_MASK | ILC_COLOR,
+                                 nImageCount, cGrow);
+        ImageList_AddMasked (himl, (HBITMAP32)handle, clrMask);
+    }
+    else if ((uType == IMAGE_ICON) || (uType == IMAGE_CURSOR)) {
+#ifdef __GET_ICON_INFO_HACK__
+        HBITMAP32 hbmImage;
+        HBITMAP32 hbmMask;
+        CURSORICONINFO *ptr;
+
+        if (!(ptr = (CURSORICONINFO *)GlobalLock16(handle))) return (NULL);
+        hbmMask  = CreateBitmap32 (ptr->nWidth, ptr->nHeight, 1, 1, 
+                                   (char *)(ptr + 1));
+        hbmImage = CreateBitmap32 (ptr->nWidth, ptr->nHeight, ptr->bPlanes,
+                                   ptr->bBitsPerPixel,
+                                   (char *)(ptr + 1) + ptr->nHeight * 
+                                   BITMAP_WIDTH_BYTES(ptr->nWidth, 1));
+        himl = ImageList_Create (ptr->nWidth, ptr->nHeight,
+                                 ILC_MASK | ILC_COLOR, 1, cGrow);
+        ImageList_Add (himl, hbmImage, hbmMask);
+        DeleteObject32 (hbmImage);
+        DeleteObject32 (hbmMask);
+        GlobalUnlock16 (handle);
+#else
+        ICONINFO32 ii;
+        BITMAP32 bmp;
+
+        GetIconInfo (hIcon, &ii);
+        GetObject32A (ii->hbmMask, sizeof(BITMAP32), (LPVOID)&bmp);
+        himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight, 
+                                 ILC_MASK | ILC_COLOR, 1, cGrow);
+        ImageList_Add (himl, ii->hbmColor, ii->hbmMask);
+#endif
+    }
+
+    DeleteObject32 (handle);
+    
+    return (himl);
+}
+
+
+HIMAGELIST WINAPI
+ImageList_Merge (HIMAGELIST himl1, INT32 i1, HIMAGELIST himl2, INT32 i2,
+                 INT32 xOffs, INT32 yOffs)
+{
+    HIMAGELIST himlDst = NULL;
+    HDC32      hdcSrcImage, hdcDstImage;
+    INT32      nX1, nX2;
+
+    himlDst = ImageList_Create (himl1->cx, himl1->cy,
+                                ILC_MASK | ILC_COLOR, 1, 1);
+    if (himlDst) {
+        hdcSrcImage = CreateCompatibleDC32 (0);
+        hdcDstImage = CreateCompatibleDC32 (0);
+        nX1 = i1 * himl1->cx;
+        nX2 = i2 * himl2->cx;
+        
+        /* copy image */
+        SelectObject32 (hdcSrcImage, himl1->hbmImage);
+        SelectObject32 (hdcDstImage, himlDst->hbmImage);
+        BitBlt32 (hdcDstImage, 0, 0, himlDst->cx, himlDst->cy, 
+                  hdcSrcImage, nX1, 0, SRCCOPY);  /* SRCCOPY */
+
+        SelectObject32 (hdcSrcImage, himl2->hbmMask);
+        BitBlt32 (hdcDstImage, xOffs, yOffs, 
+                  himlDst->cx - xOffs, himlDst->cy - yOffs, 
+                  hdcSrcImage, nX2, 0, SRCAND);
+
+        SelectObject32 (hdcSrcImage, himl2->hbmImage);
+        BitBlt32 (hdcDstImage, xOffs, yOffs, 
+                  himlDst->cx - xOffs, himlDst->cy - yOffs, 
+                  hdcSrcImage, nX2, 0, SRCPAINT);
+
+        /* copy mask */
+        SelectObject32 (hdcSrcImage, himl1->hbmMask);
+        SelectObject32 (hdcDstImage, himlDst->hbmMask);
+        BitBlt32 (hdcDstImage, 0, 0, himlDst->cx, himlDst->cy, 
+                  hdcSrcImage, nX1, 0, SRCCOPY);
+
+        SelectObject32 (hdcSrcImage, himl2->hbmMask);
+        BitBlt32 (hdcDstImage, xOffs, yOffs, 
+                  himlDst->cx - xOffs, himlDst->cy - yOffs, 
+                  hdcSrcImage, nX2, 0, SRCAND);
+
+        DeleteDC32 (hdcSrcImage);
+        DeleteDC32 (hdcDstImage);
+    }
+   
+    return (himlDst);
+}
+
+
+
+BOOL32 WINAPI
+ImageList_Replace (HIMAGELIST himl, INT32 i,  HBITMAP32 hbmImage, 
+                   HBITMAP32 hbmMask)
+{
+    HDC32 hdcImageList, hdcImage;
+
+    if ((i >= himl->cCurImage) || (i < 0)) return (FALSE);
+
+    hdcImageList = CreateCompatibleDC32 (0);
+    hdcImage = CreateCompatibleDC32 (0);
+
+    /* Replace Image */
+    SelectObject32 (hdcImageList, himl->hbmImage);
+    SelectObject32 (hdcImage, hbmImage);
+
+    BitBlt32 (hdcImageList, i * himl->cx, 0,
+              himl->cx, himl->cy, hdcImage, 0, 0, SRCCOPY);
+
+    if (himl->hbmMask) {
+        /* Replace Mask */
+        SelectObject32 (hdcImageList, himl->hbmMask);
+        SelectObject32 (hdcImage, hbmMask);
+
+        BitBlt32 (hdcImageList, i * himl->cx, 0,
+                  himl->cx, himl->cy, hdcImage, 0, 0, SRCCOPY);
+    }
+
+    DeleteDC32 (hdcImage);
+    DeleteDC32 (hdcImageList);
+
+    return (TRUE);
+}
+
+
+INT32 WINAPI
+ImageList_ReplaceIcon (HIMAGELIST himl, INT32 i, HICON32 hIcon)
+{
+    HDC32     hdcImageList, hdcImage;
+    INT32     nIndex;
+#ifdef __GET_ICON_INFO_HACK__
+    HBITMAP32 hbmImage;
+    HBITMAP32 hbmMask;
+    CURSORICONINFO *ptr;
+#else    
+    ICONINFO32 ii;
+    BITMAP32 bmp;
+#endif
+
+    if ((i >= himl->cCurImage) || (i < -1)) return (-1);
+
+#ifdef __GET_ICON_INFO_HACK__
+    if (!(ptr = (CURSORICONINFO *)GlobalLock16(hIcon))) return (-1);
+    hbmMask  = CreateBitmap32 (ptr->nWidth, ptr->nHeight, 1, 1, 
+                               (char *)(ptr + 1));
+    hbmImage = CreateBitmap32 (ptr->nWidth, ptr->nHeight, ptr->bPlanes,
+                               ptr->bBitsPerPixel,
+                               (char *)(ptr + 1) + ptr->nHeight * 
+                               BITMAP_WIDTH_BYTES(ptr->nWidth, 1));
+#else
+    GetIconInfo (hIcon, &ii);
+    GetObject32A (ii->hbmMask, sizeof(BITMAP32), (LPVOID)&bmp);
+#endif
+
+    if (i == -1) {
+        if (himl->cCurImage + 1 >= himl->cMaxImage)
+            IMAGELIST_GrowBitmaps (himl, 1);
+        nIndex = himl->cCurImage;
+        himl->cCurImage ++;
+    }
+    else
+        nIndex = i;
+
+    hdcImageList = CreateCompatibleDC32 (0);
+    hdcImage = CreateCompatibleDC32 (0);
+
+#ifdef __GET_ICON_INFO_HACK__
+    SelectObject32 (hdcImageList, himl->hbmImage);
+    SelectObject32 (hdcImage, hbmImage);
+#else
+    SelectObject32 (hdcImage, ii->hbmColor);
+#endif
+
+    BitBlt32 (hdcImageList, nIndex * himl->cx, 0,
+              himl->cx, himl->cy, hdcImage, 0, 0, SRCCOPY);
+
+    if (himl->hbmMask) {
+#ifdef __GET_ICON_INFO_HACK__
+        SelectObject32 (hdcImageList, himl->hbmMask);
+        SelectObject32 (hdcImage, hbmMask);
+#else
+        SelectObject32 (hdcImage, ii->hbmMask);
+#endif
+        BitBlt32 (hdcImageList, nIndex * himl->cx, 0,
+                  himl->cx, himl->cy, hdcImage, 0, 0, SRCCOPY);
+    }
+
+    DeleteDC32 (hdcImageList);
+    DeleteDC32 (hdcImage);
+#ifdef __GET_ICON_INFO_HACK        
+    DeleteObject32 (hbmImage);
+    DeleteObject32 (hbmMask);
+    GlobalUnlock16 (hIcon);
+#endif
+    return (nIndex);
+}
+
+
+COLORREF WINAPI
+ImageList_SetBkColor (HIMAGELIST himl, COLORREF clrBk)
+{
+    COLORREF clrOldBk;
+
+    clrOldBk = himl->clrBk;
+    himl->clrBk = clrBk;
+    return (clrOldBk);
+}
+
+
+
+BOOL32 WINAPI
+ImageList_SetOverlayImage (HIMAGELIST himl, INT32 iImage, INT32 iOverlay)
+{
+    if ((iOverlay < 1) || (iOverlay > 4)) return (FALSE);
+    if ((iImage < 0) || (iImage > himl->cCurImage)) return (FALSE);
+    
+    himl->nOvlIdx[iOverlay - 1] = iImage;
+    return (TRUE);
+}
+
diff --git a/misc/lstr.c b/misc/lstr.c
index 252d081..ff3576a 100644
--- a/misc/lstr.c
+++ b/misc/lstr.c
@@ -517,12 +517,10 @@
 	DWORD	width = dwFlags & FORMAT_MESSAGE_MAX_WIDTH_MASK;
 	DWORD	nolinefeed = 0;
 
-	dprintf_info(resource,
-		"FormatMessage32A(0x%lx,%p,%ld,0x%lx,%p,%ld,%p)\n",
-		dwFlags,lpSource,dwMessageId,dwLanguageId,lpBuffer,nSize,args
-	);
+	TRACE(resource, "(0x%lx,%p,%ld,0x%lx,%p,%ld,%p)\n",
+		     dwFlags,lpSource,dwMessageId,dwLanguageId,lpBuffer,nSize,args);
 	if (width) 
-		fprintf(stdnimp,"	- line wrapping not supported.\n");
+		FIXME(resource,"line wrapping not supported.\n");
 	from = NULL;
 	if (dwFlags & FORMAT_MESSAGE_FROM_STRING)
 		from = HEAP_strdupA( GetProcessHeap(), 0, (LPSTR)lpSource);
@@ -596,6 +594,9 @@
 							f+=strlen(f); /*at \0*/
 						}
 					} else
+					        if(!args) 
+						  break;
+					else
 						fmtstr=HEAP_strdupA(GetProcessHeap(),0,"%s");
 					if (args) {
 						if (dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY)
@@ -603,7 +604,7 @@
 						else
                                                     argliststart=(*(DWORD**)args)+insertnr-1;
 
-						if (fmtstr[strlen(fmtstr)]=='s')
+						if (fmtstr[strlen(fmtstr)-1]=='s')
 							sprintfbuf=HeapAlloc(GetProcessHeap(),0,strlen((LPSTR)argliststart[0])+1);
 						else
 							sprintfbuf=HeapAlloc(GetProcessHeap(),0,100);
@@ -683,12 +684,10 @@
 	DWORD	width = dwFlags & FORMAT_MESSAGE_MAX_WIDTH_MASK;
 	DWORD	nolinefeed = 0;
 
-	dprintf_info(resource,
-		"FormatMessage32A(0x%lx,%p,%ld,0x%lx,%p,%ld,%p)\n",
-		dwFlags,lpSource,dwMessageId,dwLanguageId,lpBuffer,nSize,args
-	);
+	TRACE(resource, "(0x%lx,%p,%ld,0x%lx,%p,%ld,%p)\n",
+		     dwFlags,lpSource,dwMessageId,dwLanguageId,lpBuffer,nSize,args);
 	if (width) 
-		fprintf(stdnimp,"	- line wrapping not supported.\n");
+		FIXME(resource,"line wrapping not supported.\n");
 	from = NULL;
 	if (dwFlags & FORMAT_MESSAGE_FROM_STRING)
 		from = HEAP_strdupWtoA(GetProcessHeap(),0,(LPWSTR)lpSource);
@@ -764,13 +763,16 @@
 							f+=strlen(f); /*at \0*/
 						}
 					} else
+					        if(!args)
+						  break;
+					else
 						fmtstr=HEAP_strdupA( GetProcessHeap(),0,"%s");
 					if (dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY)
 						argliststart=args+insertnr-1;
 					else
 						argliststart=(*(DWORD**)args)+insertnr-1;
 
-					if (fmtstr[strlen(fmtstr)]=='s') {
+					if (fmtstr[strlen(fmtstr)-1]=='s') {
 						DWORD	xarr[3];
 
 						xarr[0]=(DWORD)HEAP_strdupWtoA(GetProcessHeap(),0,(LPWSTR)(*(argliststart+0)));
diff --git a/misc/lzexpand.c b/misc/lzexpand.c
index f9defeb..7440e9d 100644
--- a/misc/lzexpand.c
+++ b/misc/lzexpand.c
@@ -118,7 +118,7 @@
  */
 INT16 WINAPI LZStart16(void)
 {
-    dprintf_info(file,"LZStart16(void)\n");
+    TRACE(file,"(void)\n");
     return 1;
 }
 
@@ -128,7 +128,7 @@
  */
 INT32 WINAPI LZStart32(void)
 {
-    dprintf_info(file,"LZStart32(void)\n");
+    TRACE(file,"(void)\n");
     return 1;
 }
 
@@ -161,7 +161,7 @@
 	struct	lzstate		*lzs;
 	DWORD	ret;
 
-	dprintf_info(file,"LZInit(%d)\n",hfSrc);
+	TRACE(file,"(%d)\n",hfSrc);
 	ret=read_header(hfSrc,&head);
 	if (ret<=0) {
 		_llseek32(hfSrc,0,SEEK_SET);
@@ -194,7 +194,7 @@
  */
 void WINAPI LZDone(void)
 {
-    dprintf_info(file,"LZDone()\n");
+    TRACE(file,"(void)\n");
 }
 
 
@@ -226,7 +226,7 @@
 	INT32		fnislowercased,ret,len;
 	LPSTR		s,t;
 
-	dprintf_info(file,"GetExpandedName(%s)\n",in);
+	TRACE(file,"(%s)\n",in);
 	fd=OpenFile32(in,&ofs,OF_READ);
 	if (fd==HFILE_ERROR32)
 		return (INT32)(INT16)LZERROR_BADINHANDLE;
@@ -322,7 +322,7 @@
 	struct	lzstate	*lzs;
 
 	buf=(LPBYTE)vbuf;
-	dprintf_info(file,"LZRead32(%d,%p,%d)\n",fd,buf,toread);
+	TRACE(file,"(%d,%p,%d)\n",fd,buf,toread);
 	howmuch=toread;
 	for (i=0;i<nroflzstates;i++)
 		if (lzstates[i].lzfd==fd)
@@ -426,7 +426,7 @@
 	struct	lzstate	*lzs;
 	LONG	newwanted;
 
-	dprintf_info(file,"LZSeek(%d,%ld,%d)\n",fd,off,type);
+	TRACE(file,"(%d,%ld,%d)\n",fd,off,type);
 	for (i=0;i<nroflzstates;i++)
 		if (lzstates[i].lzfd==fd)
 			break;
@@ -479,7 +479,7 @@
 	BYTE	buf[BUFLEN];
 	INT32	WINAPI (*xread)(HFILE32,LPVOID,UINT32);
 
-	dprintf_info(file,"LZCopy(%d,%d)\n",src,dest);
+	TRACE(file,"(%d,%d)\n",src,dest);
 	for (i=0;i<nroflzstates;i++)
 		if (src==lzstates[i].lzfd)
 			break;
@@ -545,7 +545,7 @@
 {
 	HFILE32	fd,cfd;
 
-	dprintf_info(file,"LZOpenFile(%s,%p,%d)\n",fn,ofs,mode);
+	TRACE(file,"(%s,%p,%d)\n",fn,ofs,mode);
 	/* 0x70 represents all OF_SHARE_* flags, ignore them for the check */
 	fd=OpenFile32(fn,ofs,mode);
 	if (fd==HFILE_ERROR32)
@@ -603,7 +603,7 @@
 {
 	int	i;
 
-	dprintf_info(file,"LZClose(%d)\n",fd);
+	TRACE(file,"(%d)\n",fd);
 	for (i=0;i<nroflzstates;i++)
 		if (lzstates[i].lzfd==fd)
 			break;
@@ -626,7 +626,7 @@
  */
 LONG WINAPI CopyLZFile16( HFILE16 src, HFILE16 dest )
 {
-    dprintf_info(file,"CopyLZFile16(%d,%d)\n",src,dest);
+    TRACE(file,"(%d,%d)\n",src,dest);
     return LZCopy32(src,dest);
 }
 
@@ -639,6 +639,6 @@
  */
 LONG WINAPI CopyLZFile32( HFILE32 src, HFILE32 dest )
 {
-    dprintf_info(file,"CopyLZFile32(%d,%d)\n",src,dest);
+    TRACE(file,"(%d,%d)\n",src,dest);
     return LZCopy32(src,dest);
 }
diff --git a/misc/registry.c b/misc/registry.c
index 3e47851..3f7ac03 100644
--- a/misc/registry.c
+++ b/misc/registry.c
@@ -50,7 +50,7 @@
 {
     LPWSTR   name;          /* name of value (UNICODE) or NULL for win31 */
     DWORD    type;          /* type of value */
-    DWORD    len;           /* length of data */
+    DWORD    len;           /* length of data in BYTEs */
     DWORD    lastmodified;  /* time of seconds since 1.1.1970 */
     LPBYTE   data;          /* content, may be strings, binaries, etc. */
 } KEYVALUE,*LPKEYVALUE;
@@ -117,10 +117,10 @@
 
 	for (i=0;i<nrofopenhandles;i++) {
 		if (openhandles[i].lpkey==lpkey) {
-			dprintf_warn(reg, "add_handle:Tried to add %p twice!\n",lpkey);
+			WARN(reg, "Tried to add %p twice!\n",lpkey);
 		}
 		if (openhandles[i].hkey==hkey) {
-			dprintf_warn(reg, "add_handle:Tried to add %lx twice!\n",(LONG)hkey);
+			WARN(reg, "Tried to add %lx twice!\n",(LONG)hkey);
 		}
 	}
 	openhandles=xrealloc(	openhandles,
@@ -139,7 +139,7 @@
 	for (i=0;i<nrofopenhandles;i++)
 		if (openhandles[i].hkey==hkey)
 			return openhandles[i].lpkey;
-	dprintf_warn(reg, "get_handle:Didn't find handle %lx?\n",(LONG)hkey);
+	WARN(reg, "Didn't find handle %lx?\n",(LONG)hkey);
 	return NULL;
 }
 
@@ -151,7 +151,7 @@
 		if (openhandles[i].hkey==hkey)
 			break;
 	if (i==nrofopenhandles) {
-		dprintf_warn(reg, "remove_handle:Didn't find handle %08x?\n",hkey);
+		WARN(reg, "Didn't find handle %08x?\n",hkey);
 		return;
 	}
 	memcpy(	openhandles+i,
@@ -199,7 +199,7 @@
 	case HKEY_CURRENT_CONFIG:
 		return key_current_config;
 	default:
-		dprintf_warn(reg, "lookup_hkey(%lx), special key!\n",
+		WARN(reg, "(%lx), special key!\n",
 			(LONG)hkey
 		);
 		return get_handle(hkey);
@@ -806,7 +806,7 @@
 		return 0;
 	}
 	if (ver!=REGISTRY_SAVE_VERSION) {
-		dprintf_info(reg,__FILE__":_wine_loadsubreg:Old format (%d) registry found, ignoring it. (buf was %s).\n",ver,buf);
+		TRACE(reg,"Old format (%d) registry found, ignoring it. (buf was %s).\n",ver,buf);
 		free(buf);
 		return 0;
 	}
@@ -828,7 +828,7 @@
 
 	F=fopen(fn,"rb");
 	if (F==NULL) {
-		dprintf_warn(reg,"Couldn't open %s for reading: %s\n",
+		WARN(reg,"Couldn't open %s for reading: %s\n",
 		       fn,strerror(errno)
 		);
 		return;
@@ -996,7 +996,7 @@
 {
    LPWSTR dest = xmalloc (2 * nchars + 2);
 
-   lstrcpynAtoW(dest,src, nchars);
+   lstrcpynAtoW(dest,src,nchars+1);
    dest[nchars] = 0;
    return dest;
 }
@@ -1088,7 +1088,7 @@
 
 	  if ((1 << dkv.type) & UNICONVMASK) {
 	    data = (LPBYTE) strcvtA2W(curdata, dkv.valdatalen);
-	    len = dkv.valdatalen + 1;
+	    len = 2*(dkv.valdatalen + 1);
 	  } else {
 	    /* I don't think we want to NULL terminate all data */
 	    data = xmalloc(dkv.valdatalen);
@@ -1168,7 +1168,7 @@
 	OFSTRUCT	ofs;
 	BY_HANDLE_FILE_INFORMATION hfdinfo;
 
-	dprintf_info(reg,"Loading Win95 registry database '%s'\n",fn);
+	TRACE(reg,"Loading Win95 registry database '%s'\n",fn);
 	hfd=OpenFile32(fn,&ofs,OF_READ);
 	if (hfd==HFILE_ERROR32)
 		return;
@@ -1188,7 +1188,7 @@
 	if (4!=_lread32(hfd,magic,4))
 		return;
 	if (strcmp(magic,"RGKN")) {
-		dprintf_warn(reg, "second IFF header not RGKN, but %s\n", magic);
+		WARN(reg, "second IFF header not RGKN, but %s\n", magic);
 		return;
 	}
 
@@ -1353,7 +1353,7 @@
 				}
 			}
 		} else {
-			dprintf_info(reg,"__w31_dumptree:strange: no directory key name, idx=%04x\n", idx);
+			TRACE(reg,"strange: no directory key name, idx=%04x\n", idx);
 		}
 		__w31_dumptree(dir->child_idx,txt,tab,head,xlpkey,lastmodified,level+1);
 		idx=dir->sibling_idx;
@@ -1379,12 +1379,12 @@
 
 	/* read & dump header */
 	if (sizeof(head)!=_lread32(hf,&head,sizeof(head))) {
-		dprintf_err(reg, "_w31_loadreg:reg.dat is too short.\n");
+		ERR(reg, "reg.dat is too short.\n");
 		_lclose32(hf);
 		return;
 	}
 	if (memcmp(head.cookie, "SHCC3.10", sizeof(head.cookie))!=0) {
-		dprintf_err(reg, "_w31_loadreg:reg.dat has bad signature.\n");
+		ERR(reg, "reg.dat has bad signature.\n");
 		_lclose32(hf);
 		return;
 	}
@@ -1393,7 +1393,7 @@
 	/* read and dump index table */
 	tab = xmalloc(len);
 	if (len!=_lread32(hf,tab,len)) {
-		dprintf_err(reg,"_w31_loadreg:couldn't read %d bytes.\n",len); 
+		ERR(reg,"couldn't read %d bytes.\n",len); 
 		free(tab);
 		_lclose32(hf);
 		return;
@@ -1402,14 +1402,14 @@
 	/* read text */
 	txt = xmalloc(head.textsize);
 	if (-1==_llseek32(hf,head.textoff,SEEK_SET)) {
-		dprintf_err(reg,"_w31_loadreg:couldn't seek to textblock.\n"); 
+		ERR(reg,"couldn't seek to textblock.\n"); 
 		free(tab);
 		free(txt);
 		_lclose32(hf);
 		return;
 	}
 	if (head.textsize!=_lread32(hf,txt,head.textsize)) {
-		dprintf_err(reg,"_w31_loadreg:textblock too short (%d instead of %ld).\n",len,head.textsize); 
+		ERR(reg,"textblock too short (%d instead of %ld).\n",len,head.textsize); 
 		free(tab);
 		free(txt);
 		_lclose32(hf);
@@ -1417,7 +1417,7 @@
 	}
 
 	if (!GetFileInformationByHandle(hf,&hfinfo)) {
-		dprintf_err(reg,"_w31_loadreg:GetFileInformationByHandle failed?.\n"); 
+		ERR(reg,"GetFileInformationByHandle failed?.\n"); 
 		free(tab);
 		free(txt);
 		_lclose32(hf);
@@ -1529,7 +1529,7 @@
 	LPKEYSTRUCT	lpNextKey,lpxkey;
 	LPWSTR		*wps;
 	int		wpc,i;
-	dprintf_info(reg,"RegOpenKeyEx32W(%lx,%s,%ld,%lx,%p)\n",
+	TRACE(reg,"(%lx,%s,%ld,%lx,%p)\n",
 		(LONG)hkey,W2C(lpszSubKey,0),dwReserved,samDesired,retkey
 	);
 
@@ -1571,7 +1571,7 @@
 	LPCWSTR	lpszSubKey,
 	LPHKEY	retkey
 ) {
-	dprintf_info(reg,"RegOpenKey32W(%lx,%s,%p)\n",
+	TRACE(reg,"(%lx,%s,%p)\n",
 		(LONG)hkey,W2C(lpszSubKey,0),retkey
 	);
 	return RegOpenKeyEx32W(hkey,lpszSubKey,0,KEY_ALL_ACCESS,retkey);
@@ -1589,7 +1589,7 @@
 	LPWSTR	lpszSubKeyW;
 	DWORD	ret;
 
-	dprintf_info(reg,"RegOpenKeyEx32A(%lx,%s,%ld,%lx,%p)\n",
+	TRACE(reg,"(%lx,%s,%ld,%lx,%p)\n",
 		(LONG)hkey,lpszSubKey,dwReserved,samDesired,retkey
 	);
 	if (lpszSubKey)
@@ -1608,7 +1608,7 @@
 	LPCSTR	lpszSubKey,
 	LPHKEY	retkey
 ) {
-	dprintf_info(reg,"RegOpenKey32A(%lx,%s,%p)\n",
+	TRACE(reg,"(%lx,%s,%p)\n",
 		(LONG)hkey,lpszSubKey,retkey
 	);
 	return	RegOpenKeyEx32A(hkey,lpszSubKey,0,KEY_ALL_ACCESS,retkey);
@@ -1620,7 +1620,7 @@
 	LPCSTR	lpszSubKey,
 	LPHKEY	retkey
 ) {
-	dprintf_info(reg,"RegOpenKey16(%lx,%s,%p)\n",
+	TRACE(reg,"(%lx,%s,%p)\n",
 		(LONG)hkey,lpszSubKey,retkey
 	);
 	return RegOpenKey32A(hkey,lpszSubKey,retkey);
@@ -1656,7 +1656,7 @@
 	int		wpc,i;
 
 /*FIXME: handle security/access/whatever */
-	dprintf_info(reg,"RegCreateKeyEx32W(%lx,%s,%ld,%s,%lx,%lx,%p,%p,%p)\n",
+	TRACE(reg,"(%lx,%s,%ld,%s,%lx,%lx,%p,%p,%p)\n",
 		(LONG)hkey,
 		W2C(lpszSubKey,0),
 		dwReserved,
@@ -1752,7 +1752,7 @@
 ) {
 	DWORD	junk,ret;
 
-	dprintf_info(reg,"RegCreateKey32W(%lx,%s,%p)\n",
+	TRACE(reg,"(%lx,%s,%p)\n",
 		(LONG)hkey,W2C(lpszSubKey,0),retkey
 	);
 	ret=RegCreateKeyEx32W(
@@ -1784,7 +1784,7 @@
 	LPWSTR	lpszSubKeyW,lpszClassW;
 	DWORD	ret;
 
-	dprintf_info(reg,"RegCreateKeyEx32A(%lx,%s,%ld,%s,%lx,%lx,%p,%p,%p)\n",
+	TRACE(reg,"(%lx,%s,%ld,%s,%lx,%lx,%p,%p,%p)\n",
 		(LONG)hkey,
 		lpszSubKey,
 		dwReserved,
@@ -1829,7 +1829,7 @@
 ) {
 	DWORD	junk;
 
-	dprintf_info(reg,"RegCreateKey32A(%lx,%s,%p)\n",
+	TRACE(reg,"(%lx,%s,%p)\n",
 		(LONG)hkey,lpszSubKey,retkey
 	);
 	return	RegCreateKeyEx32A(
@@ -1851,7 +1851,7 @@
 	LPCSTR	lpszSubKey,
 	LPHKEY	retkey
 ) {
-	dprintf_info(reg,"RegCreateKey16(%lx,%s,%p)\n",
+	TRACE(reg,"(%lx,%s,%p)\n",
 		(LONG)hkey,lpszSubKey,retkey
 	);
 	return RegCreateKey32A(hkey,lpszSubKey,retkey);
@@ -1881,10 +1881,9 @@
 	LPKEYSTRUCT	lpkey;
 	int		i;
 
-	dprintf_info(reg,"RegQueryValueEx32W(%x,%s,%p,%p,%p,%ld)\n",
-		hkey,W2C(lpszValueName,0),lpdwReserved,lpdwType,lpbData,
-		lpcbData?*lpcbData:0
-	);
+	TRACE(reg,"(%x,%s,%p,%p,%p,%ld)\n",
+		     hkey,W2C(lpszValueName,0),lpdwReserved,lpdwType,lpbData,
+		     lpcbData?*lpcbData:0);
 
 	lpkey	= lookup_hkey(hkey);
 	if (!lpkey)
@@ -1923,8 +1922,7 @@
 		return SHELL_ERROR_SUCCESS;
 	}
 	if (*lpcbData<lpkey->values[i].len) {
-		*(WCHAR*)lpbData
-			= 0;
+		*(WCHAR*)lpbData= 0;
 		*lpcbData	= lpkey->values[i].len;
 		return ERROR_MORE_DATA;
 	}
@@ -1943,10 +1941,9 @@
 	HKEY	xhkey;
 	DWORD	ret,lpdwType;
 
-	dprintf_info(reg,"RegQueryValue32W(%x,%s,%p,%ld)\n",
-		hkey,W2C(lpszSubKey,0),lpszData,
-		lpcbData?*lpcbData:0
-	);
+	TRACE(reg,"(%x,%s,%p,%ld)\n",
+		     hkey,W2C(lpszSubKey,0),lpszData,
+		     lpcbData?*lpcbData:0);
 
 	/* only open subkey, if we really do descend */
 	if (lpszSubKey && *lpszSubKey) {
@@ -1985,10 +1982,10 @@
 	DWORD	*mylen;
 	DWORD	type;
 
-	dprintf_info(reg,"RegQueryValueEx32A(%x,%s,%p,%p,%p,%ld)\n",
-		hkey,lpszValueName,lpdwReserved,lpdwType,lpbData,
-		lpcbData?*lpcbData:0
-	);
+	TRACE(reg,"(%x,%s,%p,%p,%p,%ld)\n",
+		     hkey,lpszValueName,lpdwReserved,lpdwType,lpbData,
+		     lpcbData?*lpcbData:0);
+
 	if (lpszValueName)
 		lpszValueNameW=strdupA2W(lpszValueName);
 	else 
@@ -2070,10 +2067,10 @@
 	LPBYTE	lpbData,
 	LPDWORD	lpcbData
 ) {
-	dprintf_info(reg,"RegQueryValueEx16(%x,%s,%p,%p,%p,%ld)\n",
-		hkey,lpszValueName,lpdwReserved,lpdwType,lpbData,
-		lpcbData?*lpcbData:0
-	);
+	TRACE(reg,"(%x,%s,%p,%p,%p,%ld)\n",
+		     hkey,lpszValueName,lpdwReserved,lpdwType,lpbData,
+		     lpcbData?*lpcbData:0);
+
 	return RegQueryValueEx32A(
 		hkey,
 		lpszValueName,
@@ -2094,10 +2091,9 @@
 	HKEY	xhkey;
 	DWORD	ret,lpdwType;
 
-	dprintf_info(reg,"RegQueryValue32A(%x,%s,%p,%ld)\n",
-		hkey,lpszSubKey,lpszData,
-		lpcbData?*lpcbData:0
-	);
+	TRACE(reg,"(%x,%s,%p,%ld)\n",
+		     hkey,lpszSubKey,lpszData,
+		     lpcbData?*lpcbData:0);
 
 	/* only open subkey, if we really do descend */
 	if (lpszSubKey && *lpszSubKey) {
@@ -2128,9 +2124,9 @@
 	LPSTR	lpszData,
 	LPDWORD	lpcbData
 ) {
-	dprintf_info(reg,"RegQueryValue16(%x,%s,%p,%ld)\n",
-		hkey,lpszSubKey,lpszData,lpcbData?*lpcbData:0
-	);
+	TRACE(reg,"(%x,%s,%p,%ld)\n",
+		     hkey,lpszSubKey,lpszData,lpcbData?*lpcbData:0);
+
 	/* HACK: the 16bit RegQueryValue doesn't handle selectorblocks
 	 *       anyway, so we just mask out the high 16 bit.
 	 *       (this (not so much incidently;) hopefully fixes Aldus FH4)
@@ -2160,7 +2156,7 @@
 	LPKEYSTRUCT	lpkey;
 	int		i;
 
-	dprintf_info(reg,"RegSetValueEx32W(%x,%s,%ld,%ld,%p,%ld)\n",
+	TRACE(reg,"(%x,%s,%ld,%ld,%p,%ld)\n",
 		hkey,W2C(lpszValueName,0),dwReserved,dwType,lpbData,cbData
 	);
 	/* we no longer care about the lpbData type here... */
@@ -2217,7 +2213,7 @@
 	LPWSTR	lpszValueNameW;
 	DWORD	ret;
 
-	dprintf_info(reg,"RegSetValueEx32A(%x,%s,%ld,%ld,%p,%ld)\n",
+	TRACE(reg,"(%x,%s,%ld,%ld,%p,%ld)\n",
 		hkey,lpszValueName,dwReserved,dwType,lpbData,cbData
 	);
 	if ((1<<dwType) & UNICONVMASK) {
@@ -2246,7 +2242,7 @@
 	LPBYTE	lpbData,
 	DWORD	cbData
 ) {
-	dprintf_info(reg,"RegSetValueEx16(%x,%s,%ld,%ld,%p,%ld)\n",
+	TRACE(reg,"(%x,%s,%ld,%ld,%p,%ld)\n",
 		hkey,lpszValueName,dwReserved,dwType,lpbData,cbData
 	);
 	return RegSetValueEx32A(hkey,lpszValueName,dwReserved,dwType,lpbData,cbData);
@@ -2263,7 +2259,7 @@
 	HKEY	xhkey;
 	DWORD	ret;
 
-	dprintf_info(reg,"RegSetValue32W(%x,%s,%ld,%s,%ld)\n",
+	TRACE(reg,"(%x,%s,%ld,%s,%ld)\n",
 		hkey,W2C(lpszSubKey,0),dwType,W2C(lpszData,0),cbData
 	);
 	if (lpszSubKey && *lpszSubKey) {
@@ -2277,7 +2273,7 @@
 		dwType=REG_SZ;
 	}
 	if (cbData!=2*lstrlen32W(lpszData)+2) {
-		dprintf_info(reg,"RegSetValueX called with len=%ld != strlen(%s)+1=%d!\n",
+		TRACE(reg,"RegSetValueX called with len=%ld != strlen(%s)+1=%d!\n",
 			cbData,W2C(lpszData,0),2*lstrlen32W(lpszData)+2
 		);
 		cbData=2*lstrlen32W(lpszData)+2;
@@ -2299,7 +2295,7 @@
 	DWORD	ret;
 	HKEY	xhkey;
 
-	dprintf_info(reg,"RegSetValue32A(%x,%s,%ld,%s,%ld)\n",
+	TRACE(reg,"(%x,%s,%ld,%s,%ld)\n",
 		hkey,lpszSubKey,dwType,lpszData,cbData
 	);
 	if (lpszSubKey && *lpszSubKey) {
@@ -2310,7 +2306,7 @@
 		xhkey=hkey;
 
 	if (dwType!=REG_SZ) {
-		dprintf_info(reg,"RegSetValueA called with dwType=%ld!\n",dwType);
+		TRACE(reg,"RegSetValueA called with dwType=%ld!\n",dwType);
 		dwType=REG_SZ;
 	}
 	if (cbData!=strlen(lpszData)+1)
@@ -2330,7 +2326,7 @@
 	DWORD	cbData
 ) {
 	DWORD	ret;
-	dprintf_info(reg,"RegSetValue16(%x,%s,%ld,%s,%ld)\n",
+	TRACE(reg,"(%x,%s,%ld,%s,%ld)\n",
 		hkey,lpszSubKey,dwType,lpszData,cbData
 	);
 	ret=RegSetValue32A(hkey,lpszSubKey,dwType,lpszData,cbData);
@@ -2358,7 +2354,7 @@
 ) {
 	LPKEYSTRUCT	lpkey,lpxkey;
 
-	dprintf_info(reg,"RegEnumKeyEx32W(%x,%ld,%p,%ld,%p,%p,%p,%p)\n",
+	TRACE(reg,"(%x,%ld,%p,%ld,%p,%p,%p,%p)\n",
 		hkey,iSubkey,lpszName,*lpcchName,lpdwReserved,lpszClass,lpcchClass,ft
 	);
 	lpkey=lookup_hkey(hkey);
@@ -2378,7 +2374,7 @@
 	memcpy(lpszName,lpxkey->keyname,lstrlen32W(lpxkey->keyname)*2+2);
 	if (lpszClass) {
 		/* what should we write into it? */
-		*lpszClass		= 0;
+		*lpszClass	= 0;
 		*lpcchClass	= 2;
 	}
 	return ERROR_SUCCESS;
@@ -2394,7 +2390,7 @@
 ) {
 	FILETIME	ft;
 
-	dprintf_info(reg,"RegEnumKey32W(%x,%ld,%p,%ld)\n",
+	TRACE(reg,"(%x,%ld,%p,%ld)\n",
 		hkey,iSubkey,lpszName,lpcchName
 	);
 	return RegEnumKeyEx32W(hkey,iSubkey,lpszName,&lpcchName,NULL,NULL,NULL,&ft);
@@ -2414,7 +2410,7 @@
 	LPWSTR	lpszNameW,lpszClassW;
 
 
-	dprintf_info(reg,"RegEnumKeyEx32A(%x,%ld,%p,%ld,%p,%p,%p,%p)\n",
+	TRACE(reg,"(%x,%ld,%p,%ld,%p,%p,%p,%p)\n",
 		hkey,iSubkey,lpszName,*lpcchName,lpdwReserved,lpszClass,lpcchClass,ft
 	);
 	if (lpszName) {
@@ -2465,7 +2461,7 @@
 ) {
 	FILETIME	ft;
 
-	dprintf_info(reg,"RegEnumKey32A(%x,%ld,%p,%ld)\n",
+	TRACE(reg,"(%x,%ld,%p,%ld)\n",
 		hkey,iSubkey,lpszName,lpcchName
 	);
 	return	RegEnumKeyEx32A(
@@ -2487,7 +2483,7 @@
 	LPSTR	lpszName,
 	DWORD	lpcchName
 ) {
-	dprintf_info(reg,"RegEnumKey16(%x,%ld,%p,%ld)\n",
+	TRACE(reg,"(%x,%ld,%p,%ld)\n",
 		hkey,iSubkey,lpszName,lpcchName
 	);
 	return RegEnumKey32A(hkey,iSubkey,lpszName,lpcchName);
@@ -2514,7 +2510,7 @@
 	LPKEYSTRUCT	lpkey;
 	LPKEYVALUE	val;
 
-	dprintf_info(reg,"RegEnumValue32W(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
+	TRACE(reg,"(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
 		hkey,iValue,lpszValue,lpcchValue,lpdReserved,lpdwType,lpbData,lpcbData
 	);
 	lpkey = lookup_hkey(hkey);
@@ -2561,7 +2557,7 @@
 	LPBYTE	lpbDataW;
 	DWORD	ret,lpcbDataW;
 
-	dprintf_info(reg,"RegEnumValue32A(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
+	TRACE(reg,"(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
 		hkey,iValue,lpszValue,lpcchValue,lpdReserved,lpdwType,lpbData,lpcbData
 	);
 
@@ -2614,7 +2610,7 @@
 	LPBYTE	lpbData,
 	LPDWORD	lpcbData
 ) {
-	dprintf_info(reg,"RegEnumValue(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
+	TRACE(reg,"(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
 		hkey,iValue,lpszValue,lpcchValue,lpdReserved,lpdwType,lpbData,lpcbData
 	);
 	return RegEnumValue32A(
@@ -2634,7 +2630,7 @@
  */
 /* RegCloseKey			[SHELL.3] [KERNEL.220] [ADVAPI32.126] */
 DWORD WINAPI RegCloseKey(HKEY hkey) {
-	dprintf_info(reg,"RegCloseKey(%x)\n",hkey);
+	TRACE(reg,"(%x)\n",hkey);
 	remove_handle(hkey);
 	return ERROR_SUCCESS;
 }
@@ -2650,17 +2646,17 @@
 	LPWSTR		*wps;
 	int		wpc,i;
 
-	dprintf_info(reg,"RegDeleteKey32W(%x,%s)\n",
+	TRACE(reg,"(%x,%s)\n",
 		hkey,W2C(lpszSubKey,0)
 	);
 	lpNextKey	= lookup_hkey(hkey);
 	if (!lpNextKey) {
-		dprintf_info(reg, "  Badkey[1].\n");
+		TRACE(reg, "  Badkey[1].\n");
 		return SHELL_ERROR_BADKEY;
 	}
 	/* we need to know the previous key in the hier. */
 	if (!lpszSubKey || !*lpszSubKey) {
-		dprintf_info(reg, "  Badkey[2].\n");
+		TRACE(reg, "  Badkey[2].\n");
 		return SHELL_ERROR_BADKEY;
 	}
 	split_keypath(lpszSubKey,&wps,&wpc);
@@ -2669,7 +2665,7 @@
 	while (i<wpc-1) {
 		lpxkey=lpNextKey->nextsub;
 		while (lpxkey) {
-			dprintf_info(reg, "  Scanning [%s]\n",
+			TRACE(reg, "  Scanning [%s]\n",
 				     W2C (lpxkey->keyname, 0));
 			if (!lstrcmpi32W(wps[i],lpxkey->keyname))
 				break;
@@ -2677,7 +2673,7 @@
 		}
 		if (!lpxkey) {
 			FREE_KEY_PATH;
-			dprintf_info(reg, "  Not found.\n");
+			TRACE(reg, "  Not found.\n");
 			/* not found is success */
 			return SHELL_ERROR_SUCCESS;
 		}
@@ -2687,7 +2683,7 @@
 	lpxkey	= lpNextKey->nextsub;
 	lplpPrevKey = &(lpNextKey->nextsub);
 	while (lpxkey) {
-		dprintf_info(reg, "  Scanning [%s]\n",
+		TRACE(reg, "  Scanning [%s]\n",
 			     W2C (lpxkey->keyname, 0));
 		if (!lstrcmpi32W(wps[i],lpxkey->keyname))
 			break;
@@ -2696,12 +2692,12 @@
 	}
 	if (!lpxkey) {
 		FREE_KEY_PATH;
-		dprintf_warn(reg , "  Not found.\n");
+		WARN(reg , "  Not found.\n");
 		return SHELL_ERROR_BADKEY;
 	}
 	if (lpxkey->nextsub) {
 		FREE_KEY_PATH;
-		dprintf_warn(reg , "  Not empty.\n");
+		WARN(reg , "  Not empty.\n");
 		return SHELL_ERROR_CANTWRITE;
 	}
 	*lplpPrevKey	= lpxkey->next;
@@ -2712,7 +2708,7 @@
 		free(lpxkey->values);
 	free(lpxkey);
 	FREE_KEY_PATH;
-	dprintf_info(reg, "  Done.\n");
+	TRACE(reg, "  Done.\n");
 	return	SHELL_ERROR_SUCCESS;
 }
 
@@ -2721,7 +2717,7 @@
 	LPWSTR	lpszSubKeyW;
 	DWORD	ret;
 
-	dprintf_info(reg,"RegDeleteKey32A(%x,%s)\n",
+	TRACE(reg,"(%x,%s)\n",
 		hkey,lpszSubKey
 	);
 	lpszSubKeyW=HEAP_strdupAtoW(GetProcessHeap(),0,lpszSubKey);
@@ -2732,7 +2728,7 @@
 
 /* RegDeleteKey			[SHELL.4] [KERNEL.219] */
 DWORD WINAPI RegDeleteKey16(HKEY hkey,LPCSTR lpszSubKey) {
-	dprintf_info(reg,"RegDeleteKey16(%x,%s)\n",
+	TRACE(reg,"(%x,%s)\n",
 		hkey,lpszSubKey
 	);
 	return RegDeleteKey32A(hkey,lpszSubKey);
@@ -2751,7 +2747,7 @@
 	LPKEYSTRUCT	lpkey;
 	LPKEYVALUE	val;
 
-	dprintf_info(reg,"RegDeleteValue32W(%x,%s)\n",
+	TRACE(reg,"(%x,%s)\n",
 		hkey,W2C(lpszValue,0)
 	);
 	lpkey=lookup_hkey(hkey);
@@ -2792,7 +2788,7 @@
 	LPWSTR	lpszValueW;
 	DWORD	ret;
 
-	dprintf_info(reg, "RegDeleteValue32A(%x,%s)\n", hkey,lpszValue );
+	TRACE(reg, "(%x,%s)\n", hkey,lpszValue );
         lpszValueW=HEAP_strdupAtoW(GetProcessHeap(),0,lpszValue);
 	ret=RegDeleteValue32W(hkey,lpszValueW);
         HeapFree(GetProcessHeap(),0,lpszValueW);
@@ -2802,14 +2798,14 @@
 /* RegDeleteValue		[KERNEL.222] */
 DWORD WINAPI RegDeleteValue16(HKEY hkey,LPSTR lpszValue)
 {
-	dprintf_info(reg,"RegDeleteValue16(%x,%s)\n", hkey,lpszValue );
+	TRACE(reg,"(%x,%s)\n", hkey,lpszValue );
 	return RegDeleteValue32A(hkey,lpszValue);
 }
 
 /* RegFlushKey			[ADVAPI32.143] [KERNEL.227] */
 DWORD WINAPI RegFlushKey(HKEY hkey)
 {
-	dprintf_fixme(reg, "RegFlushKey(%x), STUB.\n", hkey);
+	FIXME(reg, "(%x), STUB.\n", hkey);
 	return SHELL_ERROR_SUCCESS;
 }
 
@@ -2834,7 +2830,7 @@
 	int		nrofkeys,maxsubkey,maxclass,maxvalues,maxvname,maxvdata;
 	int		i;
 
-	dprintf_info(reg,"RegQueryInfoKey32W(%x,......)\n",hkey);
+	TRACE(reg,"(%x,......)\n",hkey);
 	lpkey=lookup_hkey(hkey);
 	if (!lpkey)
 		return SHELL_ERROR_BADKEY;
@@ -2909,7 +2905,7 @@
 	LPWSTR		lpszClassW;
 	DWORD		ret;
 
-	dprintf_info(reg,"RegQueryInfoKey32A(%x,......)\n",hkey);
+	TRACE(reg,"(%x,......)\n",hkey);
 	if (lpszClass) {
 		*lpcchClass*= 2;
 		lpszClassW  = (LPWSTR)xmalloc(*lpcchClass);
diff --git a/misc/shell.c b/misc/shell.c
index 69f12aa..a7ae4c0 100644
--- a/misc/shell.c
+++ b/misc/shell.c
@@ -78,11 +78,13 @@
     "Jochen Karrer",
     "Andreas Kirschbaum",
     "Albrecht Kleine",
+    "Eric Kohl",
     "Jon Konrath",
     "Alex Korobka",
     "Greg Kreider",
     "Anand Kumria",
     "Scott A. Laird",
+    "David Lee Lambert",
     "Andrew Lewycky",
     "Martin von Loewis",
     "Michiel van Loon",
@@ -155,6 +157,7 @@
     "Nikita V. Youshchenko",
     "Mikolaj Zalewski",
     "John Zero",
+    "Luiz Otavio L. Zorzella",
     NULL
 };
 
@@ -222,7 +225,7 @@
     LPSTR lpCurrent;
     WORD  i;
     
-    dprintf_info(reg,"DragQueryFile(%04x, %i, %p, %u)\n",
+    TRACE(reg,"(%04x, %i, %p, %u)\n",
 		hDrop,wFile,lpszFile,wLength);
     
     lpDropFileStruct = (LPDROPFILESTRUCT) GlobalLock16(hDrop); 
@@ -296,7 +299,7 @@
     int i;                  /* random counter */
     char xlpFile[256];      /* result of SearchPath */
 
-    dprintf_info(exec, "SHELL_FindExecutable: %s\n",
+    TRACE(exec, "%s\n",
                  (lpFile != NULL?lpFile:"-") );
     lpResult[0]='\0'; /* Start off with an empty return string */
 
@@ -322,7 +325,7 @@
     /* Make local copy & lowercase it for reg & 'programs=' lookup */
     lstrcpyn32A( tmpext, extension, 5 );
     CharLower32A( tmpext );
-    dprintf_info(exec, "SHELL_FindExecutable: %s file\n", tmpext);
+    TRACE(exec, "%s file\n", tmpext);
     
     /* Three places to check: */
     /* 1. win.ini, [windows], programs (NB no leading '.') */
@@ -348,7 +351,7 @@
 				strcpy(lpResult, xlpFile);
 				/* Need to perhaps check that the file has a path
 				 * attached */
-				dprintf_info(exec, "SHELL_FindExecutable: found %s\n",
+				TRACE(exec, "found %s\n",
 							 lpResult);
                                 return 33;
 
@@ -366,7 +369,7 @@
                          &filetypelen ) == SHELL_ERROR_SUCCESS )
     {
 	filetype[filetypelen]='\0';
-	dprintf_info(exec, "SHELL_FindExecutable: File type: %s\n",
+	TRACE(exec, "File type: %s\n",
 		     filetype);
 
 	/* Looking for ...buffer\shell\lpOperation\command */
@@ -420,7 +423,7 @@
 	  }
 	}
 
-    dprintf_info(exec, "SHELL_FindExecutable: returning %s\n", lpResult);
+    TRACE(exec, "returning %s\n", lpResult);
     return retval;
 }
 
@@ -435,7 +438,7 @@
     char old_dir[1024];
     char cmd[256];
 
-    dprintf_info(exec, "ShellExecute(%04x,'%s','%s','%s','%s',%x)\n",
+    TRACE(exec, "(%04x,'%s','%s','%s','%s',%x)\n",
 		hWnd, lpOperation ? lpOperation:"<null>", lpFile ? lpFile:"<null>",
 		lpParameters ? lpParameters : "<null>", 
 		lpDirectory ? lpDirectory : "<null>", iShowCmd);
@@ -460,7 +463,7 @@
             strcat(cmd,lpParameters);
         }
 
-        dprintf_info(exec,"ShellExecute:starting %s\n",cmd);
+        TRACE(exec,"starting %s\n",cmd);
         retval = WinExec32( cmd, iShowCmd );
     }
     if (lpDirectory) SetCurrentDirectory32A( old_dir );
@@ -498,7 +501,7 @@
     HINSTANCE32 retval=31;    /* default - 'No association was found' */
     char old_dir[1024];
 
-    dprintf_info(exec, "FindExecutable: File %s, Dir %s\n", 
+    TRACE(exec, "File %s, Dir %s\n", 
 		 (lpFile != NULL?lpFile:"-"), 
 		 (lpDirectory != NULL?lpDirectory:"-"));
 
@@ -519,7 +522,7 @@
 
     retval = SHELL_FindExecutable( lpFile, "open", lpResult );
 
-    dprintf_info(exec, "FindExecutable: returning %s\n", lpResult);
+    TRACE(exec, "returning %s\n", lpResult);
     if (lpDirectory) SetCurrentDirectory32A( old_dir );
     return retval;
 }
@@ -931,7 +934,7 @@
   HFILE32 	hFile = OpenFile32( lpszExeFileName, &ofs, OF_READ );
   UINT16	iconDirCount = 0,iconCount = 0;
   
-  dprintf_info(reg,"InternalExtractIcon(%04x,file %s,start %d,extract %d\n", 
+  TRACE(reg,"(%04x,file %s,start %d,extract %d\n", 
 		       hInstance, lpszExeFileName, nIconIndex, n);
 
   if( hFile == HFILE_ERROR32 || !n ) return 0;
@@ -966,13 +969,13 @@
 	  {
 	     iconDirCount = pTInfo->count;
 	     pIconDir = ((NE_NAMEINFO*)(pTInfo + 1));
-	     dprintf_info(reg,"\tfound directory - %i icon families\n", iconDirCount);
+	     TRACE(reg,"\tfound directory - %i icon families\n", iconDirCount);
 	  }
 	if( pTInfo->type_id == NE_RSCTYPE_ICON ) 
 	  { 
 	     iconCount = pTInfo->count;
 	     pIconStorage = ((NE_NAMEINFO*)(pTInfo + 1));
-	     dprintf_info(reg,"\ttotal icons - %i\n", iconCount);
+	     TRACE(reg,"\ttotal icons - %i\n", iconCount);
 	  }
   	pTInfo = (NE_TYPEINFO *)((char*)(pTInfo+1)+pTInfo->count*sizeof(NE_NAMEINFO));
     }
@@ -1036,13 +1039,13 @@
 	
 	fmapping = CreateFileMapping32A(hFile,NULL,PAGE_READONLY|SEC_COMMIT,0,0,NULL);
 	if (fmapping == 0) { /* FIXME, INVALID_HANDLE_VALUE? */
-		fprintf(stderr,"InternalExtractIcon:failed to create filemap.\n");
+		WARN(reg,"failed to create filemap.\n");
 		_lclose32( hFile);
 		return 0;
 	}
 	peimage = MapViewOfFile(fmapping,FILE_MAP_READ,0,0,0);
 	if (!peimage) {
-		fprintf(stderr,"InternalExtractIcon:failed to mmap filemap.\n");
+		WARN(reg,"failed to mmap filemap.\n");
 		CloseHandle(fmapping);
 		_lclose32( hFile);
 		return 0;
@@ -1066,7 +1069,7 @@
 	}
 
 	if (!rootresdir) {
-		fprintf(stderr,"InternalExtractIcon: haven't found section for resource directory.\n");
+		WARN(reg,"haven't found section for resource directory.\n");
 		UnmapViewOfFile(peimage);
 		CloseHandle(fmapping);
 		_lclose32( hFile);
@@ -1074,7 +1077,7 @@
 	}
 	icongroupresdir = GetResDirEntryW(rootresdir,(LPWSTR)RT_GROUP_ICON,(DWORD)rootresdir,FALSE);
 	if (!icongroupresdir) {
-		fprintf(stderr,"InternalExtractIcon: No Icongroupresourcedirectory!\n");
+		WARN(reg,"No Icongroupresourcedirectory!\n");
 		UnmapViewOfFile(peimage);
 		CloseHandle(fmapping);
 		_lclose32( hFile);
@@ -1091,9 +1094,8 @@
 	}
 
 	if (nIconIndex >= iconDirCount) {
-		fprintf(stderr,"nIconIndex %d is larger than iconDirCount %d\n",
-			nIconIndex,iconDirCount
-		);
+		WARN(reg,"nIconIndex %d is larger than iconDirCount %d\n",
+			    nIconIndex,iconDirCount);
 		UnmapViewOfFile(peimage);
 		CloseHandle(fmapping);
 		_lclose32( hFile);
@@ -1131,7 +1133,7 @@
 			igdata = peimage+(igdataent->OffsetToData-pe_sections[j].VirtualAddress+pe_sections[j].PointerToRawData);
 		}
 		if (!igdata) {
-			fprintf(stderr,"InternalExtractIcon: no matching real address found for icongroup!\n");
+			WARN(reg,"no matching real address for icongroup!\n");
 			UnmapViewOfFile(peimage);
 			CloseHandle(fmapping);
 			_lclose32( hFile);
@@ -1144,7 +1146,7 @@
 	}
 	iconresdir=GetResDirEntryW(rootresdir,(LPWSTR)RT_ICON,(DWORD)rootresdir,FALSE);
 	if (!iconresdir) {
-	    fprintf(stderr,"InternalExtractIcon: No Iconresourcedirectory!\n");
+	    WARN(reg,"No Iconresourcedirectory!\n");
 	    UnmapViewOfFile(peimage);
 	    CloseHandle(fmapping);
 	    _lclose32( hFile);
@@ -1168,7 +1170,7 @@
 		idata = peimage+(idataent->OffsetToData-pe_sections[j].VirtualAddress+pe_sections[j].PointerToRawData);
 	    }
 	    if (!idata) {
-		fprintf(stderr,"InternalExtractIcon: no matching real address found for icondata!\n");
+		WARN(reg,"no matching real address found for icondata!\n");
 		RetPtr[i]=0;
 		continue;
 	    }
@@ -1323,7 +1325,7 @@
 
   CharToOem32A(str,str);
 
-  dprintf_info(reg,"DoEnvSubst: accept %s\n", str);
+  TRACE(reg,"accept %s\n", str);
 
   while( *lpstr && lpbstr - lpBuffer < length )
    {
@@ -1343,8 +1345,7 @@
 
 		   if( l > length - (lpbstr - lpBuffer) - 1 )
 		     {
-		       fprintf(stdnimp,"File %s, line %i: Env subst aborted - string too short\n", 
-					__FILE__, __LINE__);
+		       WARN(reg,"Env subst aborted - string too short\n");
 		      *lpend = '%';
 		       break;
 		     }
@@ -1372,7 +1373,7 @@
   else
       length = 0;
 
-  dprintf_info(reg,"    return %s\n", str);
+  TRACE(reg,"    return %s\n", str);
 
   OemToChar32A(str,str);
   HeapFree( GetProcessHeap(), 0, lpBuffer);
@@ -1389,7 +1390,7 @@
  */
 LRESULT WINAPI ShellHookProc(INT16 code, WPARAM16 wParam, LPARAM lParam)
 {
-    dprintf_info(reg,"ShellHookProc: %i, %04x, %08x\n", code, wParam, 
+    TRACE(reg,"%i, %04x, %08x\n", code, wParam, 
 						      (unsigned)lParam );
     if( SHELL_hHook && SHELL_hWnd )
     {
@@ -1405,10 +1406,10 @@
     return CallNextHookEx16( WH_SHELL, code, wParam, lParam );
 }
 
-LRESULT WINAPI FUNC004(INT16 code, WPARAM16 wParam, LPARAM lParam)
+LRESULT WINAPI FUNC004(INT16 code, WPARAM16 wParam, /*LPARAM*/WORD lParam)
 {
-	fprintf(stderr,"FUNC004(%d,%d,%ld),STUB!\n",code,wParam,lParam);
-	return ShellHookProc(code,wParam,lParam);
+	FIXME(reg,"(%d,%d,%d),STUB!\n",code,wParam,lParam);
+	return ShellHookProc(code,wParam,(DWORD)lParam);
 }
 
 /*************************************************************************
@@ -1416,7 +1417,7 @@
  */
 BOOL32 WINAPI RegisterShellHook(HWND16 hWnd, UINT16 uAction)
 {
-    dprintf_info(reg,"RegisterShellHook: %04x [%u]\n", hWnd, uAction );
+    TRACE(reg,"%04x [%u]\n", hWnd, uAction );
 
     switch( uAction )
     {
@@ -1434,7 +1435,7 @@
 		    uMsgWndDestroyed = RegisterWindowMessage32A( lpstrMsgWndDestroyed );
 		    uMsgShellActivate = RegisterWindowMessage32A( lpstrMsgShellActivate );
 		} 
-		else fprintf( stderr, "\tunable to install ShellHookProc()!\n");
+		else WARN(reg, "unable to install ShellHookProc()!\n");
 	     }
 
 	     if( SHELL_hHook ) return ((SHELL_hWnd = hWnd) != 0);
@@ -1442,7 +1443,7 @@
 
 	default:
 
-	     fprintf( stderr, "RegisterShellHook: unknown code %i\n", uAction );
+	     WARN(reg, "unknown code %i\n", uAction );
 
 	     /* just in case */
 
@@ -1547,11 +1548,9 @@
 
 void WINAPI Control_RunDLL (HWND32 hwnd, LPCVOID code, LPCSTR cmd, DWORD arg4)
 {
-  dprintf_info(exec, "Control_RunDLL (%08x, %p, \"%s\", %08lx)\n",
-		hwnd,
-		code ? code : "(null)",
-		cmd ? cmd : "(null)",
-		arg4);
+  TRACE(exec, "(%08x, %p, \"%s\", %08lx)\n",
+		hwnd, code ? code : "(null)",
+		cmd ? cmd : "(null)", arg4);
 }
 
 /*************************************************************************
diff --git a/misc/shellord.c b/misc/shellord.c
index 9eda433..edaa2d7 100644
--- a/misc/shellord.c
+++ b/misc/shellord.c
@@ -435,26 +435,24 @@
 ) {
 	DWORD	WINAPI	(*dllgetclassob)(REFCLSID,REFIID,LPVOID);
 	DWORD		hres;
-/*
 	LPCLASSFACTORY	classfac;
- */
 
 	dllgetclassob = (DWORD(*)(REFCLSID,REFIID,LPVOID))_find_moduleproc(dllname,NULL,"DllGetClassObject");
 	if (!dllgetclassob)
 		return 0x80070000|GetLastError();
 
 /* FIXME */
+/*
 	hres = (*dllgetclassob)(clsid,(REFIID)&IID_IClassFactory,inst);
 	if (hres<0)
 		return hres;
 
-/*
+ */
 	hres = (*dllgetclassob)(clsid,(REFIID)&IID_IClassFactory,&classfac);
 	if (hres<0)
 		return hres;
 	classfac->lpvtbl->fnCreateInstance(classfac,unknownouter,refiid,inst);
 	classfac->lpvtbl->fnRelease(classfac);
- */
 	return 0;
 }
 /*************************************************************************
diff --git a/misc/spy.c b/misc/spy.c
index 9a6b3fb..2d5357c 100644
--- a/misc/spy.c
+++ b/misc/spy.c
@@ -642,21 +642,21 @@
 {
     LPCSTR pname;
 
-    if (!debugging_info(message) || SPY_EXCLUDE(msg)) return;
+    if (!TRACE_ON(message) || SPY_EXCLUDE(msg)) return;
 
     /* each SPY_SENDMESSAGE must be complemented by call to SPY_ExitMessage */
     switch(iFlag)
     {
     case SPY_DISPATCHMESSAGE16:
 	pname = SPY_GetWndName(hWnd);
-        dprintf_info(message,"%*s(%04x) %-16s message [%04x] %s dispatched  wp=%04x lp=%08lx\n",
+        TRACE(message,"%*s(%04x) %-16s message [%04x] %s dispatched  wp=%04x lp=%08lx\n",
                         SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ),
                         wParam, lParam);
         break;
 
     case SPY_DISPATCHMESSAGE32:
 	pname = SPY_GetWndName(hWnd);
-        dprintf_info(message,"%*s(%08x) %-16s message [%04x] %s dispatched  wp=%08x lp=%08lx\n",
+        TRACE(message,"%*s(%08x) %-16s message [%04x] %s dispatched  wp=%08x lp=%08lx\n",
                         SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ),
                         wParam, lParam);
         break;
@@ -674,28 +674,26 @@
 	    pname = SPY_GetWndName(hWnd);
 
             if (iFlag == SPY_SENDMESSAGE16)
-                dprintf_info(message,
-				"%*s(%04x) %-16s message [%04x] %s sent from %s wp=%04x lp=%08lx\n",
-                                SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ), 
-				taskName, wParam, lParam );
+                TRACE(message, "%*s(%04x) %-16s message [%04x] %s sent from %s wp=%04x lp=%08lx\n",
+			     SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ), 
+			     taskName, wParam, lParam );
             else
-                dprintf_info(message,
-				"%*s(%08x) %-16s message [%04x] %s sent from %s wp=%08x lp=%08lx\n",
-                                SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ), 
-				taskName, wParam, lParam );
+                TRACE(message, "%*s(%08x) %-16s message [%04x] %s sent from %s wp=%08x lp=%08lx\n",
+			     SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ), 
+			     taskName, wParam, lParam );
         }
         break;   
 
     case SPY_DEFWNDPROC16:
 	if( SPY_ExcludeDWP ) return;
-        dprintf_info(message, "%*s(%04x)  DefWindowProc16: %s [%04x]  wp=%04x lp=%08lx\n",
+        TRACE(message, "%*s(%04x)  DefWindowProc16: %s [%04x]  wp=%04x lp=%08lx\n",
                         SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ),
                         msg, wParam, lParam );
         break;
 
     case SPY_DEFWNDPROC32:
 	if( SPY_ExcludeDWP ) return;
-        dprintf_info(message, "%*s(%08x)  DefWindowProc32: %s [%04x]  wp=%08x lp=%08lx\n",
+        TRACE(message, "%*s(%08x)  DefWindowProc32: %s [%04x]  wp=%08x lp=%08lx\n",
                         SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ),
                         msg, wParam, lParam );
         break;
@@ -711,7 +709,7 @@
 {
     LPCSTR pname;
 
-    if (!debugging_info(message) || SPY_EXCLUDE(msg) ||
+    if (!TRACE_ON(message) || SPY_EXCLUDE(msg) ||
 	(SPY_ExcludeDWP && (iFlag == SPY_RESULT_DEFWND16 || iFlag == SPY_RESULT_DEFWND32)) )
 	return;
 
@@ -720,39 +718,39 @@
     switch(iFlag)
     {
     case SPY_RESULT_DEFWND16:
-	dprintf_info(message,"%*s(%04x)  DefWindowProc16: %s [%04x] returned %08lx\n",
+	TRACE(message,"%*s(%04x)  DefWindowProc16: %s [%04x] returned %08lx\n",
 			SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, lReturn );
 	break;
 
     case SPY_RESULT_DEFWND32:
-	dprintf_info(message,"%*s(%08x)  DefWindowProc32: %s [%04x] returned %08lx\n",
+	TRACE(message,"%*s(%08x)  DefWindowProc32: %s [%04x] returned %08lx\n",
 			SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, lReturn );
 	break;
 
     case SPY_RESULT_OK16:
 	pname = SPY_GetWndName(hWnd);
-        dprintf_info(message,"%*s(%04x) %-16s message [%04x] %s returned %08lx\n",
+        TRACE(message,"%*s(%04x) %-16s message [%04x] %s returned %08lx\n",
                         SPY_IndentLevel, "", hWnd, pname, msg,
                         SPY_GetMsgName( msg ), lReturn );
         break;
 
     case SPY_RESULT_OK32:
 	pname = SPY_GetWndName(hWnd);
-        dprintf_info(message,"%*s(%08x) %-16s message [%04x] %s returned %08lx\n",
+        TRACE(message,"%*s(%08x) %-16s message [%04x] %s returned %08lx\n",
                         SPY_IndentLevel, "", hWnd, pname, msg,
                         SPY_GetMsgName( msg ), lReturn );
         break; 
 
     case SPY_RESULT_INVALIDHWND16:
 	pname = SPY_GetWndName(hWnd);
-        dprintf_warn(message, "%*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n",
+        WARN(message, "%*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n",
                         SPY_IndentLevel, "", hWnd, pname, msg,
                         SPY_GetMsgName( msg ) );
         break;
 
     case SPY_RESULT_INVALIDHWND32:
 	pname = SPY_GetWndName(hWnd);
-        dprintf_warn(message, "%*s(%08x) %-16s message [%04x] %s HAS INVALID HWND\n",
+        WARN(message, "%*s(%08x) %-16s message [%04x] %s HAS INVALID HWND\n",
                         SPY_IndentLevel, "", hWnd, pname, msg,
                         SPY_GetMsgName( msg ) );
         break;
@@ -768,12 +766,12 @@
     int i;
     char buffer[1024];
 
-    if (!debugging_info(message)) return TRUE;
+    if (!TRACE_ON(message)) return TRUE;
 
     PROFILE_GetWineIniString( "Spy", "Include", "", buffer, sizeof(buffer) );
     if (buffer[0] && strcmp( buffer, "INCLUDEALL" ))
     {
-        dprintf_info(message, "SpyInit: Include=%s\n", buffer );
+        TRACE(message, "Include=%s\n", buffer );
         for (i = 0; i <= SPY_MAX_MSGNUM; i++)
             SPY_Exclude[i] = (MessageTypeNames[i] && !strstr(buffer,MessageTypeNames[i]));
     }
@@ -781,7 +779,7 @@
     PROFILE_GetWineIniString( "Spy", "Exclude", "", buffer, sizeof(buffer) );
     if (buffer[0])
     {
-        dprintf_info(message, "SpyInit: Exclude=%s\n", buffer );
+        TRACE(message, "Exclude=%s\n", buffer );
         if (!strcmp( buffer, "EXCLUDEALL" ))
             for (i = 0; i <= SPY_MAX_MSGNUM; i++) SPY_Exclude[i] = TRUE;
         else
diff --git a/misc/stress.c b/misc/stress.c
index 5714552..6320dfa 100644
--- a/misc/stress.c
+++ b/misc/stress.c
@@ -7,7 +7,7 @@
 
 int WINAPI AllocDiskSpace(long lLeft, UINT16 uDrive)
 {
-	dprintf_fixme(stress, "stress.dll: AllocDiskSpace(%d, %ld) - stub\n", 
+	FIXME(stress, "(%d, %ld) - stub\n", 
 		       uDrive, lLeft);
 
 	return 1;
@@ -15,7 +15,7 @@
 
 int WINAPI AllocFileHandles(int Left)
 {
-	dprintf_info(stress, "stress.dll: AllocFileHandles(%d) - stub\n", Left);
+	TRACE(stress, "(%d) - stub\n", Left);
 
 	if (Left < 0)
 		return -1;
@@ -25,48 +25,48 @@
 
 BOOL16 WINAPI AllocGDIMem(UINT16 uLeft)
 {
-	dprintf_info(stress, "stress.dll: AllocGDIMem(%d) - stub\n", uLeft);
+	TRACE(stress, "(%d) - stub\n", uLeft);
 
 	return 1;
 }
 
 BOOL16 WINAPI AllocMem(DWORD dwLeft)
 {
-	dprintf_fixme(stress, "stress.dll: AllocMem(%ld) - stub\n", dwLeft);
+	FIXME(stress, "(%ld) - stub\n", dwLeft);
 
 	return 1;
 }
 
 BOOL16 WINAPI AllocUserMem(UINT16 uContig)
 {
-	dprintf_info(stress, "stress.dll: AllocUserMem %d\n", uContig);
+	TRACE(stress, "AllocUserMem %d\n", uContig);
 
 	return 1;
 }
 
 void WINAPI FreeAllMem(void)
 {
-	dprintf_info(stress, "stress.dll: FreeAllMem\n");
+	TRACE(stress, "FreeAllMem\n");
 }
 
 void WINAPI FreeAllGDIMem(void)
 {
-	dprintf_info(stress, "stress.dll: FreeAllGDIMem\n");
+	TRACE(stress, "FreeAllGDIMem\n");
 }
 
 void WINAPI FreeAllUserMem(void)
 {
-	dprintf_info(stress, "stress.dll: FreeAllUserMem\n");
+	TRACE(stress, "FreeAllUserMem\n");
 }
 
 void WINAPI GetFreeAllUserMem(void)
 {
-       dprintf_info(stress, "stress.dll: GetFreeAllUserMem\n");
+       TRACE(stress, "GetFreeAllUserMem\n");
 }
 
 int WINAPI GetFreeFileHandles(void)
 {
-	dprintf_info(stress, "stress.dll: GetFreeFileHandles\n");
+	TRACE(stress, "GetFreeFileHandles\n");
 
 #ifndef OPEN_MAX
 	return _POSIX_OPEN_MAX;
@@ -77,10 +77,10 @@
 
 void WINAPI UnAllocDiskSpace(UINT16 drive)
 {
-	dprintf_info(stress, "stress.dll: UnAllocDiskSpace %d\n", drive);
+	TRACE(stress, "UnAllocDiskSpace %d\n", drive);
 }
 
 void WINAPI UnAllocFileHandles(void)
 {
-	dprintf_info(stress, "stress.dll: GetFreeAllUserMem\n");
+	TRACE(stress, "GetFreeAllUserMem\n");
 }
diff --git a/misc/toolhelp.c b/misc/toolhelp.c
index 9ec8c6f..a6520d8 100644
--- a/misc/toolhelp.c
+++ b/misc/toolhelp.c
@@ -35,7 +35,7 @@
 {
     int	i;
 
-    dprintf_info(toolhelp, "NotifyRegister(%x,%lx,%x) called.\n",
+    TRACE(toolhelp, "(%x,%lx,%x) called.\n",
                       htask, (DWORD)lpfnCallback, wFlags );
     if (!htask) htask = GetCurrentTask();
     for (i=0;i<nrofnotifys;i++)
@@ -61,7 +61,7 @@
 {
     int	i;
     
-    dprintf_info(toolhelp, "NotifyUnregister(%x) called.\n", htask );
+    TRACE(toolhelp, "(%x) called.\n", htask );
     if (!htask) htask = GetCurrentTask();
     for (i=nrofnotifys;i--;)
         if (notifys[i].htask==htask)
diff --git a/misc/tweak.c b/misc/tweak.c
index e39f95a..603f9df 100644
--- a/misc/tweak.c
+++ b/misc/tweak.c
@@ -210,8 +210,8 @@
 	    PROFILE_GetWineIniInt("Tweak.Colors", "Pen0095.Grn", 0x00),
 	    PROFILE_GetWineIniInt("Tweak.Colors", "Pen0095.Blu", 0x00)));
 
-    dprintf_info(tweak, "TWEAK_VarInit: Using %s look and feel.\n",
-		  TWEAK_Win95Look ? "Win95" : "Win3.1");
+    TRACE(tweak, "Using %s look and feel.\n",
+		 TWEAK_Win95Look ? "Win95" : "Win3.1");
     return 1;
 }
 
diff --git a/misc/ver.c b/misc/ver.c
index d58df8a..da9f8e5 100644
--- a/misc/ver.c
+++ b/misc/ver.c
@@ -54,7 +54,7 @@
     char const * teststring,
     char const * epilogue )
 {
-    dprintf_info(ver, "%s %p (\"%s\") %s\n", prologue, 
+    TRACE(ver, "%s %p (\"%s\") %s\n", prologue, 
 		(void const *) teststring, 
 		teststring ? teststring : "(null)",
 		epilogue);
@@ -72,7 +72,7 @@
 {
         dbg_decl_str(ver, 1024);
 
-	dprintf_info(ver," structversion=0x%lx.0x%lx, fileversion=0x%lx.0x%lx, productversion=0x%lx.0x%lx, flagmask=0x%lx, flags=%s%s%s%s%s%s\n",
+	TRACE(ver," structversion=0x%lx.0x%lx, fileversion=0x%lx.0x%lx, productversion=0x%lx.0x%lx, flagmask=0x%lx, flags=%s%s%s%s%s%s\n",
 		    (vffi->dwStrucVersion>>16),vffi->dwStrucVersion&0xFFFF,
 		    vffi->dwFileVersionMS,vffi->dwFileVersionLS,
 		    vffi->dwProductVersionMS,vffi->dwProductVersionLS,
@@ -106,7 +106,7 @@
 	case VOS__PM32:dsprintf(ver,"PM32");break;
 	default:dsprintf(ver,"UNKNOWN(0x%lx)",vffi->dwFileOS&0xFFFF);break;
 	}
-	dprintf_info(ver, "(%s)\n", dbg_str(ver));
+	TRACE(ver, "(%s)\n", dbg_str(ver));
 
 	dbg_reset_str(ver);
 	switch (vffi->dwFileType) {
@@ -172,9 +172,9 @@
 	case VFT_VXD:dsprintf(ver,"filetype=VXD");break;
 	case VFT_STATIC_LIB:dsprintf(ver,"filetype=STATIC_LIB");break;
 	}
-	dprintf_info(ver, "%s\n", dbg_str(ver));
+	TRACE(ver, "%s\n", dbg_str(ver));
 
-	dprintf_info(ver, "  filedata=0x%lx.0x%lx\n",
+	TRACE(ver, "  filedata=0x%lx.0x%lx\n",
 		    vffi->dwFileDateMS,vffi->dwFileDateLS);
 }
 
@@ -316,13 +316,13 @@
 	nehdoffset = LZTELL(lzfd);
 	LZREAD(&nehd);
 	if (nehd.resource_tab_offset==nehd.rname_tab_offset) {
-		dprintf_info(ver,"no resources in NE dll\n");
+		TRACE(ver,"no resources in NE dll\n");
 		return 0;
 	}
 	LZSeek32(lzfd,nehd.resource_tab_offset+nehdoffset,SEEK_SET);
 	LZREAD(&shiftcount);
-	dprintf_info(ver,"shiftcount is %d\n",shiftcount);
-	dprintf_info(ver,"reading resource typeinfo dir.\n");
+	TRACE(ver,"shiftcount is %d\n",shiftcount);
+	TRACE(ver,"reading resource typeinfo dir.\n");
 
 	if (!HIWORD(typeid)) typeid = (SEGPTR)(LOWORD(typeid) | 0x8000);
 	if (!HIWORD(resid))  resid  = (SEGPTR)(LOWORD(resid) | 0x8000);
@@ -332,7 +332,7 @@
 		LZREAD(&ti);
 		if (!ti.type_id)
 			return 0;
-		dprintf_info(ver,"    ti.typeid =%04x,count=%d\n",ti.type_id,ti.count);
+		TRACE(ver,"    ti.typeid =%04x,count=%d\n",ti.type_id,ti.count);
 
 		skipflag=0;
 		if (!HIWORD(typeid)) {
@@ -356,7 +356,7 @@
 				str=xmalloc(len);
 				if (len!=LZRead32(lzfd,str,len))
 					return 0;
-				dprintf_info(ver,"read %s to compare it with %s\n",
+				TRACE(ver,"read %s to compare it with %s\n",
 					str,(char*)PTR_SEG_TO_LIN(typeid)
 				);
 				if (lstrcmpi32A(str,(char*)PTR_SEG_TO_LIN(typeid)))
@@ -374,7 +374,7 @@
 			int	len;
 
 			LZREAD(&ni);
-			dprintf_info(ver,"	ni.id=%4x,offset=%d,length=%d\n",
+			TRACE(ver,"	ni.id=%4x,offset=%d,length=%d\n",
 				ni.id,ni.offset,ni.length
 			);
 			skipflag=1;
@@ -397,7 +397,7 @@
 					str=xmalloc(len);
 					if (len!=LZRead32(lzfd,str,len))
 						return 0;
-					dprintf_info(ver,"read %s to compare it with %s\n",
+					TRACE(ver,"read %s to compare it with %s\n",
 						str,(char*)PTR_SEG_TO_LIN(typeid)
 					);
 					if (!lstrcmpi32A(str,(char*)PTR_SEG_TO_LIN(typeid)))
@@ -416,7 +416,7 @@
 				free(rdata);
 				return 0;
 			}
-			dprintf_info(ver,"resource found.\n");
+			TRACE(ver,"resource found.\n");
 			*resdata= (BYTE*)rdata;
 			*reslen	= len;
 			return 1;
@@ -445,7 +445,7 @@
 	pehdoffset = LZTELL(lzfd);
 	LZREAD(&pehd);
 	resdir = pehd.OptionalHeader.DataDirectory[IMAGE_FILE_RESOURCE_DIRECTORY];
-	dprintf_info(ver,"find_pe_resource(.,%p,%p,....)\n",typeid,resid);
+	TRACE(ver,"(.,%p,%p,....)\n",typeid,resid);
 	if (!resdir.Size) {
 		fprintf(stderr,"misc/ver.c:find_pe_resource() no resource directory found in PE file.\n");
 		return 0;
@@ -480,20 +480,20 @@
 	resourcedir = (LPIMAGE_RESOURCE_DIRECTORY)(image+resdir.VirtualAddress);
 	xresdir = GetResDirEntryW(resourcedir,typeid,(DWORD)resourcedir,FALSE);
 	if (!xresdir) {
-		dprintf_info(ver,"...no typeid entry found for %p\n",typeid);
+		TRACE(ver,"...no typeid entry found for %p\n",typeid);
 		HeapFree(GetProcessHeap(),0,image);
 		return 0;
 	}
 	xresdir = GetResDirEntryW(xresdir,resid,(DWORD)resourcedir,FALSE);
 	if (!xresdir) {
-		dprintf_info(ver,"...no resid entry found for %p\n",resid);
+		TRACE(ver,"...no resid entry found for %p\n",resid);
 		HeapFree(GetProcessHeap(),0,image);
 		return 0;
 	}
 	
 	xresdir = GetResDirEntryW(xresdir,0,(DWORD)resourcedir,TRUE);
 	if (!xresdir) {
-		dprintf_info(ver,"...no 0 (default language) entry found for %p\n",resid);
+		TRACE(ver,"...no 0 (default language) entry found for %p\n",resid);
 		HeapFree(GetProcessHeap(),0,image);
 		return 0;
 	}
@@ -527,7 +527,7 @@
 	int			reslen=0;
 	int			res=0;
 
-	dprintf_info(ver,"GetFileResourceSize(%s,%lx,%lx,%p)\n",
+	TRACE(ver,"(%s,%lx,%lx,%p)\n",
 		filename,(LONG)restype,(LONG)resid,off
 	);
 	lzfd=LZOpenFile32A(filename,&ofs,OF_READ);
@@ -564,7 +564,7 @@
 	int			res=0;
 	int			reslen=datalen;
 
-	dprintf_info(ver,"GetFileResource(%s,%lx,%lx,%ld,%ld,%p)\n",
+	TRACE(ver,"(%s,%lx,%lx,%ld,%ld,%p)\n",
 		filename,(LONG)restype,(LONG)resid,off,datalen,data
 	);
 
@@ -603,7 +603,7 @@
 	BYTE	buf[144];
 	VS_FIXEDFILEINFO *vffi;
 
-	dprintf_info(ver,"GetFileVersionInfoSize16(%s,%p)\n",filename,handle);
+	TRACE(ver,"(%s,%p)\n",filename,handle);
 	len=GetFileResourceSize(filename,VS_FILE_INFO,VS_VERSION_INFO,handle);
 	if (!len)
 		return 0;
@@ -629,7 +629,7 @@
 	if (*(WORD*)buf < len)
 		len = *(WORD*)buf;
 
-	if(debugging_info(ver))
+	if(TRACE_ON(ver))
 	  print_vffi_debug(vffi);
 
 	return len;
@@ -638,7 +638,7 @@
 /* GetFileVersionInfoSize32A			[VERSION.1] */
 DWORD WINAPI GetFileVersionInfoSize32A(LPCSTR filename,LPDWORD handle)
 {
-	dprintf_info(ver,"GetFileVersionInfoSize32A(%s,%p)\n",filename,handle);
+	TRACE(ver,"(%s,%p)\n",filename,handle);
 	return GetFileVersionInfoSize16(filename,handle);
 }
 
@@ -655,7 +655,7 @@
 DWORD  WINAPI GetFileVersionInfo16(LPCSTR filename,DWORD handle,DWORD datasize,
                                    LPVOID data)
 {
-	dprintf_info(ver,"GetFileVersionInfo16(%s,%ld,%ld,%p)\n",
+	TRACE(ver,"(%s,%ld,%ld,%p)\n",
 		filename,handle,datasize,data
 	);
 	return GetFileResource(
@@ -712,27 +712,27 @@
     retval = 0;
 
     /* Print out debugging information */
-    dprintf_info(ver, "VerFindFile() called with parameters:\n"
-		"\tflags = %x", flags);
+    TRACE(ver, "called with parameters:\n"
+		 "\tflags = %x", flags);
     if(flags & VFFF_ISSHAREDFILE)
-	dprintf_info(ver, " (VFFF_ISSHAREDFILE)\n");
+	TRACE(ver, " (VFFF_ISSHAREDFILE)\n");
     else
-	dprintf_info(ver, "\n");
+	TRACE(ver, "\n");
 
     ver_dstring("\tlpszFilename = ", lpszFilename, "");
     ver_dstring("\tlpszWinDir = ", lpszWinDir, "");
     ver_dstring("\tlpszAppDir = ", lpszAppDir, "");
 
-    dprintf_info(ver, "\tlpszCurDir = %p\n", lpszCurDir);
+    TRACE(ver, "\tlpszCurDir = %p\n", lpszCurDir);
     if(lpuCurDirLen)
-	dprintf_info(ver, "\tlpuCurDirLen = %p (%u)\n",
+	TRACE(ver, "\tlpuCurDirLen = %p (%u)\n",
 		    lpuCurDirLen, *lpuCurDirLen);
     else
-	dprintf_info(ver, "\tlpuCurDirLen = (null)\n");
+	TRACE(ver, "\tlpuCurDirLen = (null)\n");
 
-    dprintf_info(ver, "\tlpszDestDir = %p\n", lpszDestDir);
+    TRACE(ver, "\tlpszDestDir = %p\n", lpszDestDir);
     if(lpuDestDirLen)
-	dprintf_info(ver, "\tlpuDestDirLen = %p (%u)\n",
+	TRACE(ver, "\tlpuDestDirLen = %p (%u)\n",
 		    lpuDestDirLen, *lpuDestDirLen);
 
     /* Figure out where the file should go; shared files default to the
@@ -820,21 +820,21 @@
 	*lpuCurDirLen = curDirSizeReq;
     }
 
-    dprintf_info(ver, "VerFindFile() ret = %lu (%s%s%s)\n", retval,
-		(retval & VFF_CURNEDEST) ? "VFF_CURNEDEST " : "",
-		(retval & VFF_FILEINUSE) ? "VFF_FILEINUSE " : "",
-		(retval & VFF_BUFFTOOSMALL) ? "VFF_BUFFTOOSMALL " : "");
+    TRACE(ver, "ret = %lu (%s%s%s)\n", retval,
+		 (retval & VFF_CURNEDEST) ? "VFF_CURNEDEST " : "",
+		 (retval & VFF_FILEINUSE) ? "VFF_FILEINUSE " : "",
+		 (retval & VFF_BUFFTOOSMALL) ? "VFF_BUFFTOOSMALL " : "");
 
     ver_dstring("\t(Exit) lpszCurDir = ", lpszCurDir, "");
     if(lpuCurDirLen)
-	dprintf_info(ver, "\t(Exit) lpuCurDirLen = %p (%u)\n",
+	TRACE(ver, "\t(Exit) lpuCurDirLen = %p (%u)\n",
 		    lpuCurDirLen, *lpuCurDirLen);
     else
-	dprintf_info(ver, "\t(Exit) lpuCurDirLen = (null)\n");
+	TRACE(ver, "\t(Exit) lpuCurDirLen = (null)\n");
 
     ver_dstring("\t(Exit) lpszDestDir = ", lpszDestDir, "");
     if(lpuDestDirLen)
-	dprintf_info(ver, "\t(Exit) lpuDestDirLen = %p (%u)\n",
+	TRACE(ver, "\t(Exit) lpuDestDirLen = %p (%u)\n",
 		    lpuDestDirLen, *lpuDestDirLen);
 
     return retval;
@@ -1191,13 +1191,13 @@
 
 	while (1) {
 		db=(struct dbA*)block;
-		dprintf_info(ver,"db=%p,db->nextoff=%d,db->datalen=%d,db->name=%s\n",
+		TRACE(ver,"db=%p,db->nextoff=%d,db->datalen=%d,db->name=%s\n",
 			db,db->nextoff,db->datalen,db->name
 		);
 		if ((!db->nextoff) || (buff_remain<=0)) /* no more entries ? */
 			return NULL;
 
-		dprintf_info(ver,"comparing with %s\n",db->name);
+		TRACE(ver,"comparing with %s\n",db->name);
 		if (!lstrncmpi32A(db->name,str,substrlen)) {
 			if (nextslash) {
 				inc_size=DATA_OFFSET_A(db)+((db->datalen+3)&~3);
@@ -1248,7 +1248,7 @@
 		} else
 			vs = HEAP_strdupA(GetProcessHeap(),0,"no data");
 
-		dprintf_info(ver,"db->nextoff=%d,db->name=%s,db->data=\"%s\"\n",
+		TRACE(ver,"db->nextoff=%d,db->name=%s,db->data=\"%s\"\n",
 			db->nextoff,xs,vs
 		);
 		HeapFree(GetProcessHeap(),0,vs);
@@ -1284,7 +1284,7 @@
 	LPSTR	s;
 	BYTE	*block=PTR_SEG_TO_LIN(segblock),*b;
 
-	dprintf_info(ver,"VerQueryValue16(%p,%s,%p,%d)\n",
+	TRACE(ver,"(%p,%s,%p,%d)\n",
 		block,subblock,buffer,*buflen
 	);
 
@@ -1312,10 +1312,10 @@
 		*buflen	= db->datalen;
 		if (db->btext) {
 		    xs = HEAP_strdupWtoA(GetProcessHeap(),0,(WCHAR*)b);
-		    dprintf_info(ver,"->%s\n",xs);
+		    TRACE(ver,"->%s\n",xs);
 		    HeapFree(GetProcessHeap(),0,xs);
 		} else
-		    dprintf_info(ver,"->%p\n",b);
+		    TRACE(ver,"->%p\n",b);
 	} else {
 		struct	dbA	*db;
 		b=_find_dataA(block,s,*(WORD*)block);
@@ -1330,9 +1330,9 @@
 		*buflen	= db->datalen;
 		/* the string is only printable, if it is below \\StringFileInfo*/
 		if (!lstrncmpi32A("VS_VERSION_INFO\\StringFileInfo\\",s,strlen("VS_VERSION_INFO\\StringFileInfo\\")))
-		    dprintf_info(ver,"	-> %s=%s\n",subblock,b);
+		    TRACE(ver,"	-> %s=%s\n",subblock,b);
 		else
-		    dprintf_info(ver,"	-> %s=%p\n",subblock,b);
+		    TRACE(ver,"	-> %s=%p\n",subblock,b);
 	}
 	*buffer	= (b-block)+segblock;
 	free(s);
@@ -1345,7 +1345,7 @@
 	BYTE	*b,*block=(LPBYTE)vblock,**buffer=(LPBYTE*)vbuffer;
 	LPSTR	s;
 
-	dprintf_info(ver,"VerQueryValue32A(%p,%s,%p,%d)\n",
+	TRACE(ver,"(%p,%s,%p,%d)\n",
 		block,subblock,buffer,*buflen
 	);
 
@@ -1374,10 +1374,10 @@
 		b	= b+DATA_OFFSET_W(db);
 		if (db->btext) {
 		    xs = HEAP_strdupWtoA(GetProcessHeap(),0,(WCHAR*)b);
-		    dprintf_info(ver,"->%s\n",xs);
+		    TRACE(ver,"->%s\n",xs);
 		    HeapFree(GetProcessHeap(),0,xs);
 		} else
-		    dprintf_info(ver,"->%p\n",b);
+		    TRACE(ver,"->%p\n",b);
 		/* This is a leak.  */
 		b = HEAP_strdupWtoA(GetProcessHeap(),0,(WCHAR*)b);
 	} else {
@@ -1395,9 +1395,9 @@
 
 		/* the string is only printable, if it is below \\StringFileInfo*/
 		if (!lstrncmpi32A("VS_VERSION_INFO\\StringFileInfo\\",s,strlen("VS_VERSION_INFO\\StringFileInfo\\")))
-		    dprintf_info(ver,"	-> %s=%s\n",subblock,b);
+		    TRACE(ver,"	-> %s=%s\n",subblock,b);
 		else
-		    dprintf_info(ver,"	-> %s=%p\n",subblock,b);
+		    TRACE(ver,"	-> %s=%p\n",subblock,b);
 	}
 	*buffer	= b;
 	free(s);
diff --git a/misc/windebug.c b/misc/windebug.c
index 5f73299..3f17f9b 100644
--- a/misc/windebug.c
+++ b/misc/windebug.c
@@ -20,10 +20,11 @@
 	switch (AX_reg(context))
 	{
 		case 0x000D:
-		case 0x000E:	/* __asm__("pushl $0x0\n\t"); ??? */
-				break;
+		case 0x000E:
 		case 0x0060:	/* do nothing */
 				break;
+		case 0x0062: 
+				break;
 		case 0x0063:	/* do something complicated */
 				break;
 		case 0x0064:	/* do something complicated */
diff --git a/misc/winsock.c b/misc/winsock.c
index 239c456..ec78b4b 100644
--- a/misc/winsock.c
+++ b/misc/winsock.c
@@ -205,7 +205,7 @@
 
     optlen = sizeof(optval);
     getsockopt(s, SOL_SOCKET, SO_ERROR, &optval, &optlen);
-    if (optval) dprintf_warn(winsock, "\t[%i] error: %d\n", s, optval);
+    if (optval) WARN(winsock, "\t[%i] error: %d\n", s, optval);
     return optval != 0;
 }
 
@@ -248,7 +248,7 @@
 	if( b32 ) wsfds32->fd_count = j;
 	else wsfds16->fd_count = j;
 
-	dprintf_info(winsock, "\n");
+	TRACE(winsock, "\n");
 #undef wsfds32
 #undef wsfds16
     }
@@ -303,7 +303,7 @@
     HTASK16             tid = GetCurrentTask();
     LPWSINFO            pwsi;
 
-    dprintf_info(winsock, "WSAStartup: verReq=%x\n", wVersionRequested);
+    TRACE(winsock, "verReq=%x\n", wVersionRequested);
 
     if (LOBYTE(wVersionRequested) < 1 || (LOBYTE(wVersionRequested) == 1 &&
         HIBYTE(wVersionRequested) < 1)) return WSAVERNOTSUPPORTED;
@@ -358,7 +358,7 @@
 
     memcpy(lpWSAData, &WINSOCK_data, sizeof(WINSOCK_data));
 
-    dprintf_info(winsock, "WSAStartup: succeeded\n");
+    TRACE(winsock, "succeeded\n");
     return 0;
 }
 
@@ -410,12 +410,12 @@
 	WINSOCK_Shutdown();	/* just in case */
 
     if( pwsi->flags & WSI_BLOCKINGCALL )
-	dprintf_info(winsock,"\tinside blocking call!\n");
+	TRACE(winsock,"\tinside blocking call!\n");
 
 /* FIXME: aop_control() doesn't decrement pwsi->num_async_rq
  *
  *    if( pwsi->num_async_rq )
- *	  dprintf_warn(winsock,"\thave %i outstanding async ops!\n", pwsi->num_async_rq );
+ *	  WARN(winsock,"\thave %i outstanding async ops!\n", pwsi->num_async_rq );
  */
 
     for(i = 0, j = 0, n = 0; i < WS_MAX_SOCKETS_PER_PROCESS; i++)
@@ -429,7 +429,7 @@
             close(pwsi->sock[i].fd); j++; 
         }
     if( j ) 
-	  dprintf_info(winsock,"\tclosed %i sockets, killed %i async selects!\n", j, n);
+	  TRACE(winsock,"\tclosed %i sockets, killed %i async selects!\n", j, n);
 
     /* delete scratch buffers */
 
@@ -447,7 +447,7 @@
 {
     HTASK16	hTask = GetCurrentTask();
 
-    dprintf_info(winsock, "WSACleanup(%04x)\n", hTask );
+    TRACE(winsock, "(%04x)\n", hTask );
     if( hTask )
     {
 	LPWSINFO pwsi = wsi_find(hTask);
@@ -469,7 +469,7 @@
     LPWSINFO pwsi = wsi_find(GetCurrentTask());
     INT16    ret = (pwsi) ? pwsi->err : WSANOTINITIALISED;
 
-    dprintf_info(winsock, "WSAGetLastError(%08x) = %i\n", 
+    TRACE(winsock, "(%08x) = %i\n", 
 		    (unsigned)pwsi, (int)ret);
     return ret;
 }
@@ -481,7 +481,7 @@
 {
     LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WSASetLastError(%08x): %d\n", (unsigned)pwsi, (int)iError);
+    TRACE(winsock, "(%08x): %d\n", (unsigned)pwsi, (int)iError);
     if( pwsi ) pwsi->err = iError;
 }
 
@@ -522,7 +522,7 @@
     ws_socket*	pws  = (ws_socket*)WS_HANDLE2PTR((SOCKET16)s);
     LPWSINFO	pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_ACCEPT(%08x): socket %04x\n", 
+    TRACE(winsock, "(%08x): socket %04x\n", 
 				  (unsigned)pwsi, (UINT16)s ); 
     if( _check_ws(pwsi, pws) )
     {
@@ -573,7 +573,7 @@
     ws_socket*    pws  = (ws_socket*)WS_HANDLE2PTR(s);
     LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_BIND(%08x): socket %04x, ptr %8x, length %d\n", 
+    TRACE(winsock, "(%08x): socket %04x, ptr %8x, length %d\n", 
 			   (unsigned)pwsi, s, (int) name, namelen);
 #if DEBUG_SOCKADDR
     dump_sockaddr(name);
@@ -585,7 +585,7 @@
 	  if ( bind(pws->fd, name, namelen) < 0 ) 
 	  {
 	     int	loc_errno = errno;
-	     dprintf_warn(winsock, "\tfailure - errno = %i\n", errno);
+	     WARN(winsock, "\tfailure - errno = %i\n", errno);
 	     errno = loc_errno;
 	     switch(errno)
 	     {
@@ -616,7 +616,7 @@
     ws_socket*    pws  = (ws_socket*)WS_HANDLE2PTR(s);
     LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_CLOSE(%08x): socket %08x\n", (unsigned)pwsi, s);
+    TRACE(winsock, "(%08x): socket %08x\n", (unsigned)pwsi, s);
 
     if( _check_ws(pwsi, pws) )
     { 
@@ -651,7 +651,7 @@
   ws_socket*    pws  = (ws_socket*)WS_HANDLE2PTR(s);
   LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_CONNECT(%08x): socket %04x, ptr %8x, length %d\n", 
+  TRACE(winsock, "(%08x): socket %04x, ptr %8x, length %d\n", 
 			   (unsigned)pwsi, s, (int) name, namelen);
 #if DEBUG_SOCKADDR
   dump_sockaddr(name);
@@ -709,7 +709,7 @@
     ws_socket*    pws  = (ws_socket*)WS_HANDLE2PTR(s);
     LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_GETPEERNAME(%08x): socket: %04x, ptr %8x, ptr %8x\n", 
+    TRACE(winsock, "(%08x): socket: %04x, ptr %8x, ptr %8x\n", 
 			   (unsigned)pwsi, s, (int) name, *namelen);
     if( _check_ws(pwsi, pws) )
     {
@@ -746,7 +746,7 @@
     ws_socket*    pws  = (ws_socket*)WS_HANDLE2PTR(s);
     LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_GETSOCKNAME(%08x): socket: %04x, ptr %8x, ptr %8x\n", 
+    TRACE(winsock, "(%08x): socket: %04x, ptr %8x, ptr %8x\n", 
 			  (unsigned)pwsi, s, (int) name, (int) *namelen);
     if( _check_ws(pwsi, pws) )
     {
@@ -790,7 +790,7 @@
     ws_socket*    pws  = (ws_socket*)WS_HANDLE2PTR(s);
     LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_GETSOCKOPT(%08x): socket: %04x, opt %d, ptr %8x, ptr %8x\n", 
+    TRACE(winsock, "(%08x): socket: %04x, opt %d, ptr %8x, ptr %8x\n", 
 			   (unsigned)pwsi, s, level, (int) optval, (int) *optlen);
     if( _check_ws(pwsi, pws) )
     {
@@ -883,7 +883,7 @@
   ws_socket*    pws  = (ws_socket*)WS_HANDLE2PTR(s);
   LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_IOCTL(%08x): socket %04x, cmd %08x, ptr %8x\n", 
+  TRACE(winsock, "(%08x): socket %04x, cmd %08x, ptr %8x\n", 
 			  (unsigned)pwsi, s, cmd, (unsigned) argp);
   if( _check_ws(pwsi, pws) )
   {
@@ -916,7 +916,7 @@
 
 	default:	  
 		/* Netscape tries hard to use bogus ioctl 0x667e */
-		dprintf_warn(winsock, "\tunknown WS_IOCTL cmd (%08x)\n", cmd);
+		WARN(winsock, "\tunknown WS_IOCTL cmd (%08x)\n", cmd);
     }
     if( ioctl(pws->fd, newcmd, (char*)argp ) == 0 ) return 0;
     pwsi->err = (errno == EBADF) ? WSAENOTSOCK : wsaErrno(); 
@@ -941,7 +941,7 @@
     ws_socket*    pws  = (ws_socket*)WS_HANDLE2PTR(s);
     LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_LISTEN(%08x): socket %04x, backlog %d\n", 
+    TRACE(winsock, "(%08x): socket %04x, backlog %d\n", 
 			    (unsigned)pwsi, s, backlog);
     if( _check_ws(pwsi, pws) )
     {
@@ -979,7 +979,7 @@
     ws_socket*    pws  = (ws_socket*)WS_HANDLE2PTR(s);
     LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_RECV(%08x): socket %04x, buf %8x, len %d, "
+    TRACE(winsock, "(%08x): socket %04x, buf %8x, len %d, "
 		    "flags %d\n", (unsigned)pwsi, s, (unsigned)buf, 
 		    len, flags);
     if( _check_ws(pwsi, pws) )
@@ -987,7 +987,7 @@
 	INT32 length;
 	if ((length = recv(pws->fd, buf, len, flags)) >= 0) 
 	{ 
-	    dprintf_info(winsock, " -> %i bytes\n", length);
+	    TRACE(winsock, " -> %i bytes\n", length);
 
 	    if( pws->psop && (pws->flags & (WS_FD_READ | WS_FD_CLOSE)) )
 		EVENT_AddIO( pws->fd, EVENT_IO_READ );	/* reenabler */
@@ -997,7 +997,7 @@
 	pwsi->err = wsaErrno();
     }
     else if( pwsi ) pwsi->err = WSAENOTSOCK;
-    dprintf_warn(winsock, " -> ERROR\n");
+    WARN(winsock, " -> ERROR\n");
     return SOCKET_ERROR;
 }
 
@@ -1019,7 +1019,7 @@
     ws_socket*    pws  = (ws_socket*)WS_HANDLE2PTR(s);
     LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_RECVFROM(%08x): socket %04x, ptr %08x, "
+    TRACE(winsock, "(%08x): socket %04x, ptr %08x, "
 		    "len %d, flags %d\n", (unsigned)pwsi, s, (unsigned)buf,
 		    len, flags);
 #if DEBUG_SOCKADDR
@@ -1033,7 +1033,7 @@
 
 	if ((length = recvfrom(pws->fd, buf, len, flags, from, fromlen32)) >= 0)
 	{
-	    dprintf_info(winsock, " -> %i bytes\n", length);
+	    TRACE(winsock, " -> %i bytes\n", length);
 
 	    if( pws->psop && (pws->flags & (WS_FD_READ | WS_FD_CLOSE)) )
 		EVENT_AddIO( pws->fd, EVENT_IO_READ );  /* reenabler */
@@ -1043,7 +1043,7 @@
 	pwsi->err = wsaErrno();
     }
     else if( pwsi ) pwsi->err = WSAENOTSOCK;
-    dprintf_warn(winsock, " -> ERROR\n");
+    WARN(winsock, " -> ERROR\n");
     return SOCKET_ERROR;
 }
 
@@ -1071,7 +1071,7 @@
 {
     LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 	
-    dprintf_info(winsock, "WS_SELECT(%08x): read %8x, write %8x, excp %8x\n", 
+    TRACE(winsock, "(%08x): read %8x, write %8x, excp %8x\n", 
     (unsigned) pwsi, (unsigned) ws_readfds, (unsigned) ws_writefds, (unsigned) ws_exceptfds);
 
     if( pwsi )
@@ -1150,7 +1150,7 @@
     ws_socket*    pws  = (ws_socket*)WS_HANDLE2PTR(s);
     LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_SEND(%08x): socket %04x, ptr %08x, length %d, flags %d\n", 
+    TRACE(winsock, "(%08x): socket %04x, ptr %08x, length %d, flags %d\n", 
 			   (unsigned)pwsi, s, (unsigned) buf, len, flags);
     if( _check_ws(pwsi, pws) )
     {
@@ -1186,7 +1186,7 @@
     ws_socket*    pws  = (ws_socket*)WS_HANDLE2PTR(s);
     LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_SENDTO(%08x): socket %04x, ptr %08x, length %d, flags %d\n",
+    TRACE(winsock, "(%08x): socket %04x, ptr %08x, length %d, flags %d\n",
                           (unsigned)pwsi, s, (unsigned) buf, len, flags);
     if( _check_ws(pwsi, pws) )
     {
@@ -1223,7 +1223,7 @@
     ws_socket*    pws  = (ws_socket*)WS_HANDLE2PTR(s);
     LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_SETSOCKOPT(%08x): socket %04x, lev %d, opt %d, ptr %08x, len %d\n",
+    TRACE(winsock, "(%08x): socket %04x, lev %d, opt %d, ptr %08x, len %d\n",
 			  (unsigned)pwsi, s, level, optname, (int) optval, optlen);
     if( _check_ws(pwsi, pws) )
     {
@@ -1263,7 +1263,7 @@
     ws_socket*    pws  = (ws_socket*)WS_HANDLE2PTR(s);
     LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_SHUTDOWN(%08x): socket %04x, how %i\n",
+    TRACE(winsock, "(%08x): socket %04x, how %i\n",
 			    (unsigned)pwsi, s, how );
     if( _check_ws(pwsi, pws) )
     {
@@ -1328,7 +1328,7 @@
 {
   LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_SOCKET(%08x): af=%d type=%d protocol=%d\n", 
+  TRACE(winsock, "(%08x): af=%d type=%d protocol=%d\n", 
 			  (unsigned)pwsi, af, type, protocol);
 
   if( pwsi )
@@ -1372,7 +1372,7 @@
     {
         ws_socket*      pnew = wsi_alloc_socket(pwsi, sock);
 
-	dprintf_info(winsock,"\tcreated %i (handle %04x)\n", sock, (UINT16)WS_PTR2HANDLE(pnew));
+	TRACE(winsock,"\tcreated %i (handle %04x)\n", sock, (UINT16)WS_PTR2HANDLE(pnew));
 
         if( pnew ) 
 	{
@@ -1392,7 +1392,7 @@
     } else pwsi->err = wsaErrno();
   }
  
-  dprintf_warn(winsock, "\t\tfailed!\n");
+  WARN(winsock, "\t\tfailed!\n");
   return INVALID_SOCKET32;
 }
 
@@ -1439,7 +1439,7 @@
 SEGPTR WINAPI WINSOCK_gethostbyaddr16(const char *addr, INT16 len, INT16 type)
 {
     struct WIN_hostent* retval;
-    dprintf_info(winsock, "WS_GetHostByAddr16: ptr %08x, len %d, type %d\n",
+    TRACE(winsock, "ptr %08x, len %d, type %d\n",
                             (unsigned) addr, len, type);
     retval = __ws_gethostbyaddr( addr, len, type, WS_DUP_SEGPTR );
     return retval ? SEGPTR_GET(retval) : ((SEGPTR)NULL);
@@ -1448,7 +1448,7 @@
 struct WIN_hostent* WINAPI WINSOCK_gethostbyaddr32(const char *addr, INT32 len,
                                                 INT32 type)
 {
-    dprintf_info(winsock, "WS_GetHostByAddr32: ptr %08x, len %d, type %d\n",
+    TRACE(winsock, "ptr %08x, len %d, type %d\n",
                              (unsigned) addr, len, type);
     return __ws_gethostbyaddr(addr, len, type, WS_DUP_LINEAR);
 }
@@ -1475,14 +1475,14 @@
 SEGPTR WINAPI WINSOCK_gethostbyname16(const char *name)
 {
     struct WIN_hostent* retval;
-    dprintf_info(winsock, "WS_GetHostByName16: %s\n", (name)?name:NULL_STRING);
+    TRACE(winsock, "%s\n", (name)?name:NULL_STRING);
     retval = __ws_gethostbyname( name, WS_DUP_SEGPTR );
     return (retval)? SEGPTR_GET(retval) : ((SEGPTR)NULL) ;
 }
 
 struct WIN_hostent* WINAPI WINSOCK_gethostbyname32(const char* name)
 {
-    dprintf_info(winsock, "WS_GetHostByName32: %s\n", (name)?name:NULL_STRING);
+    TRACE(winsock, "%s\n", (name)?name:NULL_STRING);
     return __ws_gethostbyname( name, WS_DUP_LINEAR );
 }
 
@@ -1509,14 +1509,14 @@
 SEGPTR WINAPI WINSOCK_getprotobyname16(const char *name)
 {
     struct WIN_protoent* retval;
-    dprintf_info(winsock, "WS_GetProtoByName16: %s\n", (name)?name:NULL_STRING);
+    TRACE(winsock, "%s\n", (name)?name:NULL_STRING);
     retval = __ws_getprotobyname(name, WS_DUP_SEGPTR);
     return retval ? SEGPTR_GET(retval) : ((SEGPTR)NULL);
 }
 
 struct WIN_protoent* WINAPI WINSOCK_getprotobyname32(const char* name)
 {
-    dprintf_info(winsock, "WS_GetProtoByName32: %s\n", (name)?name:NULL_STRING);
+    TRACE(winsock, "%s\n", (name)?name:NULL_STRING);
     return __ws_getprotobyname(name, WS_DUP_LINEAR);
 }
 
@@ -1543,14 +1543,14 @@
 SEGPTR WINAPI WINSOCK_getprotobynumber16(INT16 number)
 {
     struct WIN_protoent* retval;
-    dprintf_info(winsock, "WS_GetProtoByNumber16: %i\n", number);
+    TRACE(winsock, "%i\n", number);
     retval = __ws_getprotobynumber(number, WS_DUP_SEGPTR);
     return retval ? SEGPTR_GET(retval) : ((SEGPTR)NULL);
 }
 
 struct WIN_protoent* WINAPI WINSOCK_getprotobynumber32(INT32 number)
 {
-    dprintf_info(winsock, "WS_GetProtoByNumber32: %i\n", number);
+    TRACE(winsock, "%i\n", number);
     return __ws_getprotobynumber(number, WS_DUP_LINEAR);
 }
 
@@ -1581,7 +1581,7 @@
 SEGPTR WINAPI WINSOCK_getservbyname16(const char *name, const char *proto)
 {
     struct WIN_servent* retval;
-    dprintf_info(winsock, "WS_GetServByName16: '%s', '%s'\n",
+    TRACE(winsock, "'%s', '%s'\n",
                             (name)?name:NULL_STRING, (proto)?proto:NULL_STRING);
     retval = __ws_getservbyname(name, proto, WS_DUP_SEGPTR);
     return retval ? SEGPTR_GET(retval) : ((SEGPTR)NULL);
@@ -1589,7 +1589,7 @@
 
 struct WIN_servent* WINAPI WINSOCK_getservbyname32(const char *name, const char *proto)
 {
-    dprintf_info(winsock, "WS_GetServByName32: '%s', '%s'\n",
+    TRACE(winsock, "'%s', '%s'\n",
                             (name)?name:NULL_STRING, (proto)?proto:NULL_STRING);
     return __ws_getservbyname(name, proto, WS_DUP_LINEAR);
 }
@@ -1621,7 +1621,7 @@
 SEGPTR WINAPI WINSOCK_getservbyport16(INT16 port, const char *proto)
 {
     struct WIN_servent* retval;
-    dprintf_info(winsock, "WS_GetServByPort16: %i, '%s'\n",
+    TRACE(winsock, "%i, '%s'\n",
                             (int)port, (proto)?proto:NULL_STRING);
     retval = __ws_getservbyport(port, proto, WS_DUP_SEGPTR);
     return retval ? SEGPTR_GET(retval) : ((SEGPTR)NULL);
@@ -1629,7 +1629,7 @@
 
 struct WIN_servent* WINAPI WINSOCK_getservbyport32(INT32 port, const char *proto)
 {
-    dprintf_info(winsock, "WS_GetServByPort32: %i, '%s'\n",
+    TRACE(winsock, "%i, '%s'\n",
                             (int)port, (proto)?proto:NULL_STRING);
     return __ws_getservbyport(port, proto, WS_DUP_LINEAR);
 }
@@ -1642,7 +1642,7 @@
 {
     LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_GetHostName(%08x): name %s, len %d\n",
+    TRACE(winsock, "(%08x): name %s, len %d\n",
                           (unsigned)pwsi, (name)?name:NULL_STRING, namelen);
     if( pwsi )
     {
@@ -1682,8 +1682,8 @@
 {
   LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_AsyncGetHostByAddr16(%08x): hwnd %04x, msg %04x, addr %08x[%i]\n",
-                          (unsigned)pwsi, hWnd, uMsg, (unsigned)addr , len );
+  TRACE(winsock, "(%08x): hwnd %04x, msg %04x, addr %08x[%i]\n",
+	       (unsigned)pwsi, hWnd, uMsg, (unsigned)addr , len );
 
   if( pwsi ) 
     return __WSAsyncDBQuery(pwsi, hWnd, uMsg, type, addr, len,
@@ -1699,8 +1699,8 @@
 {
   LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_AsyncGetHostByAddr32(%08x): hwnd %04x, msg %08x, addr %08x[%i]\n",
-                          (unsigned)pwsi, (HWND16)hWnd, uMsg, (unsigned)addr , len );
+  TRACE(winsock, "(%08x): hwnd %04x, msg %08x, addr %08x[%i]\n",
+	       (unsigned)pwsi, (HWND16)hWnd, uMsg, (unsigned)addr , len );
 
   if( pwsi )
     return __WSAsyncDBQuery(pwsi, hWnd, uMsg, type, addr, len,
@@ -1717,7 +1717,7 @@
 {
   LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_AsyncGetHostByName16(%08x): hwnd %04x, msg %04x, host %s, 
+  TRACE(winsock, "(%08x): hwnd %04x, msg %04x, host %s, 
 buffer %i\n", (unsigned)pwsi, hWnd, uMsg, (name)?name:NULL_STRING, (int)buflen );
 
   if( pwsi )
@@ -1733,8 +1733,9 @@
 					LPSTR sbuf, INT32 buflen)
 {
   LPWSINFO              pwsi = wsi_find(GetCurrentTask());
-  dprintf_info(winsock, "WS_AsyncGetHostByName32(%08x): hwnd %04x, msg %08x, host %s, 
-buffer %i\n", (unsigned)pwsi, (HWND16)hWnd, uMsg, (name)?name:NULL_STRING, (int)buflen );
+  TRACE(winsock, "(%08x): hwnd %04x, msg %08x, host %s, buffer %i\n", 
+	       (unsigned)pwsi, (HWND16)hWnd, uMsg, 
+	       (name)?name:NULL_STRING, (int)buflen );
   if( pwsi )
     return __WSAsyncDBQuery(pwsi, hWnd, uMsg, 0, name, 0,
  			    NULL, (void*)sbuf, buflen, WSMSG_ASYNC_HOSTBYNAME | WSMSG_ASYNC_WIN32);
@@ -1750,8 +1751,8 @@
 {
   LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_AsyncGetProtoByName16(%08x): hwnd %04x, msg %08x, protocol %s\n",
-                          (unsigned)pwsi, (HWND16)hWnd, uMsg, (name)?name:NULL_STRING );
+  TRACE(winsock, "(%08x): hwnd %04x, msg %08x, protocol %s\n",
+	       (unsigned)pwsi, (HWND16)hWnd, uMsg, (name)?name:NULL_STRING );
 
   if( pwsi )
     return __WSAsyncDBQuery(pwsi, hWnd, uMsg, 0, name, 0,
@@ -1767,8 +1768,8 @@
 {
   LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_AsyncGetProtoByName32(%08x): hwnd %04x, msg %08x, protocol %s\n",
-                          (unsigned)pwsi, (HWND16)hWnd, uMsg, (name)?name:NULL_STRING );
+  TRACE(winsock, "(%08x): hwnd %04x, msg %08x, protocol %s\n",
+	       (unsigned)pwsi, (HWND16)hWnd, uMsg, (name)?name:NULL_STRING );
 
   if( pwsi )
     return __WSAsyncDBQuery(pwsi, hWnd, uMsg, 0, name, 0,
@@ -1785,8 +1786,8 @@
 {
   LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_AsyncGetProtoByNumber16(%08x): hwnd %04x, msg %04x, num %i\n",
-                          (unsigned)pwsi, hWnd, uMsg, number );
+  TRACE(winsock, "(%08x): hwnd %04x, msg %04x, num %i\n",
+	       (unsigned)pwsi, hWnd, uMsg, number );
 
   if( pwsi )
     return __WSAsyncDBQuery(pwsi, hWnd, uMsg, number, NULL, 0,
@@ -1802,8 +1803,8 @@
 {
   LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_AsyncGetProtoByNumber32(%08x): hwnd %04x, msg %08x, num %i\n",
-                          (unsigned)pwsi, (HWND16)hWnd, uMsg, number );
+  TRACE(winsock, "(%08x): hwnd %04x, msg %08x, num %i\n",
+	       (unsigned)pwsi, (HWND16)hWnd, uMsg, number );
 
   if( pwsi )
     return __WSAsyncDBQuery(pwsi, hWnd, uMsg, number, NULL, 0,
@@ -1820,8 +1821,9 @@
 {
   LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_AsyncGetServByName16(%08x): hwnd %04x, msg %04x, name %s, proto %s\n",
-                   (unsigned)pwsi, hWnd, uMsg, (name)?name:NULL_STRING, (proto)?proto:NULL_STRING );
+  TRACE(winsock, "(%08x): hwnd %04x, msg %04x, name %s, proto %s\n",
+	       (unsigned)pwsi, hWnd, uMsg, 
+	       (name)?name:NULL_STRING, (proto)?proto:NULL_STRING );
 
   if( pwsi )
   {
@@ -1842,8 +1844,9 @@
 {
   LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_AsyncGetServByName32(%08x): hwnd %04x, msg %08x, name %s, proto %s\n",
-           (unsigned)pwsi, (HWND16)hWnd, uMsg, (name)?name:NULL_STRING, (proto)?proto:NULL_STRING );
+  TRACE(winsock, "(%08x): hwnd %04x, msg %08x, name %s, proto %s\n",
+	       (unsigned)pwsi, (HWND16)hWnd, uMsg, 
+	       (name)?name:NULL_STRING, (proto)?proto:NULL_STRING );
   if( pwsi )
   {
       int i = wsi_strtolo( pwsi, name, proto );
@@ -1864,8 +1867,8 @@
 {
   LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_AsyncGetServByPort16(%08x): hwnd %04x, msg %04x, port %i, proto %s\n",
-                           (unsigned)pwsi, hWnd, uMsg, port, (proto)?proto:NULL_STRING );
+  TRACE(winsock, "(%08x): hwnd %04x, msg %04x, port %i, proto %s\n",
+	       (unsigned)pwsi, hWnd, uMsg, port, (proto)?proto:NULL_STRING );
 
   if( pwsi )
   {
@@ -1886,8 +1889,8 @@
 {
   LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_AsyncGetServByPort32(%08x): hwnd %04x, msg %08x, port %i, proto %s\n",
-                           (unsigned)pwsi, (HWND16)hWnd, uMsg, port, (proto)?proto:NULL_STRING );
+  TRACE(winsock, "(%08x): hwnd %04x, msg %08x, port %i, proto %s\n",
+	       (unsigned)pwsi, (HWND16)hWnd, uMsg, port, (proto)?proto:NULL_STRING );
 
   if( pwsi )
   {
@@ -1910,7 +1913,7 @@
     LPWSINFO		pwsi = wsi_find(GetCurrentTask());
     ws_async_op*	p_aop = (ws_async_op*)WS_HANDLE2PTR(hAsyncTaskHandle);
 
-    dprintf_info(winsock, "WS_CancelAsyncRequest(%08x): handle %08x\n", 
+    TRACE(winsock, "(%08x): handle %08x\n", 
 			   (unsigned)pwsi, hAsyncTaskHandle);
     if( pwsi )
     {
@@ -1950,7 +1953,7 @@
     DWORD		dwEvent, dwErrBytes;
     int			num_posted;
 
-    dprintf_info(winsock,"WINSOCK_HandleIO: %i pending descriptors\n", num_pending );
+    TRACE(winsock,"%i pending descriptors\n", num_pending );
 
     for( num_posted = dwEvent = 0 ; psop; psop = psop->next )
     {
@@ -1968,7 +1971,7 @@
 	     * Reenabling calls turn them back on.
 	     */
 
-	    dprintf_info(winsock,"\tchecking psop = 0x%08x\n", (unsigned) psop );
+	    TRACE(winsock,"\tchecking psop = 0x%08x\n", (unsigned) psop );
 
 	    num_pending--;
 
@@ -2044,7 +2047,7 @@
 		    if( PostMessage32A( psop->hWnd, psop->uMsg, (WPARAM32)WS_PTR2HANDLE(psop->pws), 
 			              (LPARAM)WSAMAKESELECTREPLY( WS_FD_WRITE, 0 ) ) )
 		    {
-			dprintf_info(winsock, "\t    hwnd %04x - %04x, %08x\n",
+			TRACE(winsock, "\t    hwnd %04x - %04x, %08x\n",
                                 psop->hWnd, psop->uMsg, (unsigned)MAKELONG(WS_FD_WRITE, 0) );
 			FD_CLR( fd, &event_set[EVENT_IO_WRITE] );
 			num_posted++;
@@ -2106,7 +2109,7 @@
 
 	    if( bPost )
 	    {
-		dprintf_info(winsock, "\t    hwnd %04x - %04x, %08x\n", 
+		TRACE(winsock, "\t    hwnd %04x - %04x, %08x\n", 
 				psop->hWnd, psop->uMsg, (unsigned)dwEvent );
 		PostMessage32A( psop->hWnd, psop->uMsg, 
 			      (WPARAM32)WS_PTR2HANDLE(psop->pws), (LPARAM)dwEvent );
@@ -2117,7 +2120,7 @@
 	if( num_pending <= 0 ) break;
     }
 
-    dprintf_info(winsock, "\tdone, %i posted events\n", num_posted );
+    TRACE(winsock, "\tdone, %i posted events\n", num_posted );
     return ( num_posted ) ? TRUE : FALSE;
 }
 
@@ -2126,7 +2129,7 @@
     ws_socket*    pws  = (ws_socket*)WS_HANDLE2PTR(s);
     LPWSINFO      pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_AsyncSelect(%08x): %04x, hWnd %04x, uMsg %08x, event %08x\n",
+    TRACE(winsock, "(%08x): %04x, hWnd %04x, uMsg %08x, event %08x\n",
 			  (unsigned)pwsi, (SOCKET16)s, (HWND16)hWnd, uMsg, (unsigned)lEvent );
     if( _check_ws(pwsi, pws) )
     {
@@ -2147,7 +2150,7 @@
 	    if( pws->flags & (WS_FD_CONNECT | WS_FD_WRITE) )
 		EVENT_DeleteIO( pws->fd, EVENT_IO_WRITE );
 
-	    dprintf_info(winsock,"\tremoving psop = 0x%08x\n", (unsigned) psop );
+	    TRACE(winsock,"\tremoving psop = 0x%08x\n", (unsigned) psop );
 
 	    WS_FREE( pws->psop );
 	    pws->flags &= ~(WS_FD_RAW | WS_FD_ACCEPT | WS_FD_CONNECT | 
@@ -2186,7 +2189,7 @@
 
 		/* TODO: handle WS_FD_ACCEPT right away if the socket is readable */
 
-		dprintf_info(winsock,"\tcreating psop = 0x%08x\n", (unsigned)psop );
+		TRACE(winsock,"\tcreating psop = 0x%08x\n", (unsigned)psop );
 
 		return 0; /* success */
 	    }
@@ -2211,7 +2214,7 @@
 {
   int i = set->fd_count;
   
-  dprintf_info(winsock, "__WSAFDIsSet16(%d,%8lx(%i))\n", s,(unsigned long)set, i);
+  TRACE(winsock, "(%d,%8lx(%i))\n", s,(unsigned long)set, i);
     
   while (i--)
       if (set->fd_array[i] == s) return 1;
@@ -2225,7 +2228,7 @@
 {
   int i = set->fd_count;
 
-  dprintf_info(winsock, "__WSAFDIsSet32(%d,%8lx(%i))\n", s,(unsigned long)set, i);
+  TRACE(winsock, "(%d,%8lx(%i))\n", s,(unsigned long)set, i);
 
   while (i--)
       if (set->fd_array[i] == s) return 1;
@@ -2245,7 +2248,7 @@
    * Note: It is allowed to call this function without prior WSAStartup().
    */
 
-  dprintf_info(winsock, "WS_IsBlocking()\n");
+  TRACE(winsock, "\n");
   return FALSE;
 }
 
@@ -2256,7 +2259,7 @@
 {
   LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_CancelBlockingCall(%08x)\n", (unsigned)pwsi);
+  TRACE(winsock, "(%08x)\n", (unsigned)pwsi);
 
   if( pwsi ) return 0;
   return SOCKET_ERROR;
@@ -2271,8 +2274,8 @@
   FARPROC16		prev;
   LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_SetBlockingHook16(%08x): hook %08x\n", 
-			  (unsigned)pwsi, (unsigned) lpBlockFunc);
+  TRACE(winsock, "(%08x): hook %08x\n", 
+	       (unsigned)pwsi, (unsigned) lpBlockFunc);
   if( pwsi ) 
   { 
       prev = (FARPROC16)pwsi->blocking_hook; 
@@ -2292,8 +2295,8 @@
   FARPROC32             prev;
   LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-  dprintf_info(winsock, "WS_SetBlockingHook32(%08x): hook %08x\n",
-                          (unsigned)pwsi, (unsigned) lpBlockFunc);
+  TRACE(winsock, "(%08x): hook %08x\n",
+	       (unsigned)pwsi, (unsigned) lpBlockFunc);
   if( pwsi ) {
       prev = (FARPROC32)pwsi->blocking_hook;
       pwsi->blocking_hook = (DWORD)lpBlockFunc;
@@ -2311,7 +2314,7 @@
 {
     LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_UnhookBlockingHook16(%08x)\n", (unsigned)pwsi);
+    TRACE(winsock, "(%08x)\n", (unsigned)pwsi);
     if( pwsi ) return (INT16)(pwsi->blocking_hook = 0);
     return SOCKET_ERROR;
 }
@@ -2324,7 +2327,7 @@
 {
     LPWSINFO              pwsi = wsi_find(GetCurrentTask());
 
-    dprintf_info(winsock, "WS_UnhookBlockingHook32(%08x)\n", (unsigned)pwsi);
+    TRACE(winsock, "(%08x)\n", (unsigned)pwsi);
     if( pwsi )
     {
 	pwsi->blocking_hook = 0;
@@ -2571,10 +2574,10 @@
 {
     int	loc_errno = errno; 
 #if defined(__FreeBSD__)
-       dprintf_err(winsock, "winsock: errno %d, (%s).\n", 
+       ERR(winsock, "errno %d, (%s).\n", 
                 			 errno, strerror(errno));
 #else
-       dprintf_err(winsock, "winsock: errno %d\n", errno);
+       ERR(winsock, "errno %d\n", errno);
 #endif
 
     switch(loc_errno)
@@ -2646,10 +2649,10 @@
     int		loc_errno = h_errno;
 
 #if defined(__FreeBSD__)
-    dprintf_err(winsock, "winsock: h_errno %d, (%s).\n", 
+    ERR(winsock, "h_errno %d, (%s).\n", 
                	    h_errno, strerror(h_errno));
 #else
-    dprintf_err(winsock, "winsock: h_errno %d.\n", h_errno);
+    ERR(winsock, "h_errno %d.\n", h_errno);
 #endif
 
     switch(loc_errno)
diff --git a/misc/winsock_dns.c b/misc/winsock_dns.c
index 029d973..b00b4ef 100644
--- a/misc/winsock_dns.c
+++ b/misc/winsock_dns.c
@@ -34,7 +34,9 @@
 #include "heap.h"
 #include "ldt.h"
 #include "message.h"
+#include "selectors.h"
 #include "miscemu.h"
+#include "sig_context.h"
 #include "debug.h"
 
 #ifndef FASYNC
@@ -136,7 +138,7 @@
     int num = 0;
     ws_async_op*   p, *next;
 
-    dprintf_info(winsock," cancelling async DNS requests... \n");
+    TRACE(winsock," cancelling async DNS requests... \n");
 
     SIGNAL_MaskAsyncEvents( TRUE );
     next = __async_op_list;
@@ -153,7 +155,7 @@
 	}
     }
     SIGNAL_MaskAsyncEvents( FALSE );
-    dprintf_info(winsock," -> %i total\n", num );
+    TRACE(winsock," -> %i total\n", num );
 }
 
 void WINSOCK_link_async_op(ws_async_op* p_aop)
@@ -176,7 +178,7 @@
 	  {
 	      ws_async_op* dead = p;
 
-	      dprintf_info(winsock,"\treaping dead aop [%08x]\n", (unsigned)p );
+	      TRACE(winsock,"\treaping dead aop [%08x]\n", (unsigned)p );
 
 	      p = p->next;
 	      WINSOCK_unlink_async_op( dead );
@@ -218,12 +220,14 @@
  * Note: pipe-based handlers must raise explicit SIGIO with kill(2).
  */
 
-void WINSOCK_sigio(int signal)
+HANDLER_DEF(WINSOCK_sigio)
 {
  struct timeval         timeout;
  fd_set                 check_set;
  ws_async_op*		p_aop;
 
+ HANDLER_INIT();
+
  check_set = __async_io_fdset;
  memset(&timeout, 0, sizeof(timeout));
 
@@ -343,7 +347,7 @@
 	    async_ctl.ws_aop->pid = fork();
 	    if( async_ctl.ws_aop->pid )
 	    {
-		dprintf_info(winsock, "\tasync_op = %04x (child %i)\n", 
+		TRACE(winsock, "\tasync_op = %04x (child %i)\n", 
 				handle, async_ctl.ws_aop->pid);
 
 		close(async_ctl.ws_aop->fd[1]);  /* write endpoint */
@@ -452,7 +456,7 @@
 	 : gethostbyaddr(async_ctl.rq.name,
 		 	 async_ctl.ilength, async_ctl.type);
 
-  dprintf_info(winsock,"DNS: got hostent for [%s]\n", async_ctl.rq.name );
+  TRACE(winsock,"DNS: got hostent for [%s]\n", async_ctl.rq.name );
 
   if( p_he ) /* convert to the Winsock format with internal pointers as offsets */
       size = WS_dup_he(pwsi, p_he, WS_DUP_OFFSET | 
@@ -476,7 +480,7 @@
 	 ? getprotobyname(async_ctl.rq.name)
 	 : getprotobynumber(async_ctl.type);
 
-  dprintf_info(winsock,"DNS: got protoent for [%s]\n", async_ctl.rq.name );
+  TRACE(winsock,"DNS: got protoent for [%s]\n", async_ctl.rq.name );
 
   if( p_pe ) /* convert to the Winsock format with internal pointers as offsets */
       size = WS_dup_pe(pwsi, p_pe, WS_DUP_OFFSET |
diff --git a/misc/wsprintf.c b/misc/wsprintf.c
index 043f5e9..fffa2e6 100644
--- a/misc/wsprintf.c
+++ b/misc/wsprintf.c
@@ -396,7 +396,7 @@
         maxlen -= len;
     }
     *p = 0;
-    dprintf_info(string,"%s\n",buffer);
+    TRACE(string,"%s\n",buffer);
     return (maxlen > 1) ? (INT32)(p - buffer) : -1;
 }
 
@@ -477,7 +477,7 @@
  */
 INT16 WINAPI wvsprintf16( LPSTR buffer, LPCSTR spec, LPCVOID args )
 {
-    dprintf_info(string,"wvsprintf16 for %p got:\n",buffer);
+    TRACE(string,"for %p got:\n",buffer);
     return wvsnprintf16( buffer, 0xffff, spec, args );
 }
 
@@ -487,7 +487,7 @@
  */
 INT32 WINAPI wvsprintf32A( LPSTR buffer, LPCSTR spec, va_list args )
 {
-    dprintf_info(string,"wvsprintf32A for %p got:\n",buffer);
+    TRACE(string,"for %p got:\n",buffer);
     return wvsnprintf32A( buffer, 0xffffffff, spec, args );
 }
 
@@ -497,7 +497,7 @@
  */
 INT32 WINAPI wvsprintf32W( LPWSTR buffer, LPCWSTR spec, va_list args )
 {
-    dprintf_info(string,"wvsprintf32W for %p got:\n",buffer);
+    TRACE(string,"for %p got:\n",buffer);
     return wvsnprintf32W( buffer, 0xffffffff, spec, args );
 }
 
@@ -511,7 +511,7 @@
     va_list valist;
     INT16 res;
 
-    dprintf_info(string,"wsprintf16 for %p got:\n",buffer);
+    TRACE(string,"for %p got:\n",buffer);
     va_start( valist, spec );
     /* Note: we call the 32-bit version, because the args are 32-bit */
     res = (INT16)wvsnprintf32A( buffer, 0xffffffff, spec, valist );
@@ -529,7 +529,7 @@
     VA_START16( valist );
     buffer = VA_ARG16( valist, SEGPTR );
     spec   = VA_ARG16( valist, SEGPTR );
-    dprintf_info(string,"WIN16_wsprintf16 got:\n");
+    TRACE(string,"got:\n");
     res = wvsnprintf16( (LPSTR)PTR_SEG_TO_LIN(buffer), 0xffff,
                         (LPCSTR)PTR_SEG_TO_LIN(spec), valist );
     VA_END16( valist );
@@ -545,7 +545,7 @@
     va_list valist;
     INT32 res;
 
-    dprintf_info(string,"wsprintf32A for %p got:\n",buffer);
+    TRACE(string,"for %p got:\n",buffer);
     va_start( valist, spec );
     res = wvsnprintf32A( buffer, 0xffffffff, spec, valist );
     va_end( valist );
@@ -561,7 +561,7 @@
     va_list valist;
     INT32 res;
 
-    dprintf_info(string,"wsprintf32W for %p\n",buffer);
+    TRACE(string,"wsprintf32W for %p\n",buffer);
     va_start( valist, spec );
     res = wvsnprintf32W( buffer, 0xffffffff, spec, valist );
     va_end( valist );
diff --git a/miscemu/emulate.c b/miscemu/emulate.c
index 9261eaa..f141a44 100644
--- a/miscemu/emulate.c
+++ b/miscemu/emulate.c
@@ -28,7 +28,7 @@
 
 void WINAPI WIN87_fpmath( CONTEXT *context )
 {
-    dprintf_info(int, "_fpmath: (cs:eip=%x:%lx es=%x bx=%04x ax=%04x dx==%04x)\n",
+    TRACE(int, "(cs:eip=%x:%lx es=%x bx=%04x ax=%04x dx==%04x)\n",
                  (WORD)CS_reg(context), EIP_reg(context),
                  (WORD)ES_reg(context), BX_reg(context),
                  AX_reg(context), DX_reg(context) );
@@ -74,7 +74,7 @@
              */
 /* FIXME: could someone who really understands asm() fix this please? --AJ */
 /*            __asm__("fistp %0;wait" : "=m" (dw) : : "memory"); */
-            dprintf_info(int,"emulate.c:On top of stack was %ld\n",dw);
+            TRACE(int,"On top of stack was %ld\n",dw);
             AX_reg(context) = LOWORD(dw);
             DX_reg(context) = HIWORD(dw);
         }
@@ -108,18 +108,18 @@
 void WINAPI WIN87_WinEm87Info(struct Win87EmInfoStruct *pWIS,
                               int cbWin87EmInfoStruct)
 {
-  dprintf_info(int, "__WinEm87Info(%p,%d)\n",pWIS,cbWin87EmInfoStruct);
+  TRACE(int, "(%p,%d)\n",pWIS,cbWin87EmInfoStruct);
 }
 
 void WINAPI WIN87_WinEm87Restore(void *pWin87EmSaveArea,
                                  int cbWin87EmSaveArea)
 {
-  dprintf_info(int, "__WinEm87Restore(%p,%d)\n",
+  TRACE(int, "(%p,%d)\n",
 	pWin87EmSaveArea,cbWin87EmSaveArea);
 }
 
 void WINAPI WIN87_WinEm87Save(void *pWin87EmSaveArea, int cbWin87EmSaveArea)
 {
-  dprintf_info(int, "__WinEm87Save(%p,%d)\n",
+  TRACE(int, "(%p,%d)\n",
 	pWin87EmSaveArea,cbWin87EmSaveArea);
 }
diff --git a/msdos/dosmem.c b/msdos/dosmem.c
index 8c326db..4482cf9 100644
--- a/msdos/dosmem.c
+++ b/msdos/dosmem.c
@@ -387,7 +387,7 @@
    LPVOID       lin;
 
    lin=DOSMEM_dosmem+(x&0xffff)+(((x&0xffff0000)>>16)*16);
-   dprintf_info(selector,"DOSMEM_MapR2L(0x%08lx) returns 0x%p.\n",
+   TRACE(selector,"(0x%08lx) returns 0x%p.\n",
                     x,lin );
    return lin;
 }
@@ -406,7 +406,7 @@
 		GMEM_FIXED,DOSMEM_dosmem+realsel*16,0x10000,
 		hModule,FALSE,FALSE,FALSE,NULL
 	);
-	dprintf_info(selector,"DOSMEM_AllocSelector(0x%04x) returns 0x%04x.\n",
+	TRACE(selector,"(0x%04x) returns 0x%04x.\n",
 		realsel,sel
 	);
 	return sel;
diff --git a/msdos/dpmi.c b/msdos/dpmi.c
index d4648c6..91466c1 100644
--- a/msdos/dpmi.c
+++ b/msdos/dpmi.c
@@ -350,7 +350,7 @@
             ldt_entry entry;
             LDT_BytesToEntry( PTR_SEG_OFF_TO_LIN( ES_reg(context),
                                                   DI_reg(context) ), &entry );
-            LDT_GetEntry( SELECTOR_TO_ENTRY( BX_reg(context) ), &entry );
+            LDT_SetEntry( SELECTOR_TO_ENTRY( BX_reg(context) ), &entry );
         }
         break;
 
diff --git a/msdos/int13.c b/msdos/int13.c
index 8fa70ab..761b2ad 100644
--- a/msdos/int13.c
+++ b/msdos/int13.c
@@ -133,6 +133,18 @@
                 SET_CFLAG(context);
 		break;
 
+	case 0x17:	   /* SET DISK TYPE FOR FORMAT */
+		if (DL_reg(context) < 4)
+		    AH_reg(context) = 0x00; /* successful completion */
+		else
+		    AH_reg(context) = 0x01; /* error */
+		break;
+	case 0x18:
+		if (DL_reg(context) < 4)
+		    AH_reg(context) = 0x00; /* successful completion */
+		else
+		    AH_reg(context) = 0x01; /* error */
+		break;
 	default:
 		INT_BARF( context, 0x13 );
     }
diff --git a/msdos/int1a.c b/msdos/int1a.c
index 90c03c5..350a9a9 100644
--- a/msdos/int1a.c
+++ b/msdos/int1a.c
@@ -55,7 +55,7 @@
             CX_reg(context) = HIWORD(ticks);
             DX_reg(context) = LOWORD(ticks);
             AX_reg(context) = 0;  /* No midnight rollover */
-            dprintf_info(int,"int1a_00 // ticks=%ld\n", ticks);
+            TRACE(int,"int1a: AH=00 -- ticks=%ld\n", ticks);
             break;
 		
 	case 2: 
diff --git a/msdos/int21.c b/msdos/int21.c
index 04df4e1..ce1b51c 100644
--- a/msdos/int21.c
+++ b/msdos/int21.c
@@ -169,7 +169,7 @@
         }
         else if (heap || INT21_CreateHeap())
         {
-                dprintf_fixme(int, "int21: GetDrivePB not fully implemented.\n");
+                FIXME(int21, "GetDrivePB not fully implemented.\n");
 
                 /* FIXME: I have no idea what a lot of this information should
                  * say or whether it even really matters since we're not allowing
@@ -206,7 +206,7 @@
 static void ioctlGetDeviceInfo( CONTEXT *context )
 {
     int curr_drive;
-    dprintf_info(int, "int21: ioctl (%d, GetDeviceInfo)\n", BX_reg(context));
+    TRACE(int21, "(%d)\n", BX_reg(context));
     
     curr_drive = DRIVE_GetCurrentDrive();
     DX_reg(context) = 0x0140 + curr_drive + ((curr_drive > 1) ? 0x0800 : 0); /* no floppy */
@@ -238,7 +238,7 @@
 	switch (CL_reg(context)) 
 	{
 		case 0x4a: /* lock logical volume */
-			dprintf_info(int,"int21: lock logical volume (%d) level %d mode %d\n",drive,BH_reg(context),DX_reg(context));
+			TRACE(int21,"lock logical volume (%d) level %d mode %d\n",drive,BH_reg(context),DX_reg(context));
 			break;
 
 		case 0x60: /* get device parameters */
@@ -279,7 +279,7 @@
 			break;
 
 		case 0x6a:
-			dprintf_info(int,"int21: logical volume %d unlocked.\n",drive);
+			TRACE(int21,"logical volume %d unlocked.\n",drive);
 			break;
 
 		default:
@@ -336,9 +336,8 @@
 	    break;
 
 	  case 0x30:    /* DENYREAD */
-	    dprintf_info(int,
-	      "OpenExistingFile (%s): DENYREAD changed to DENYALL\n",
-	      (char *)PTR_SEG_OFF_TO_LIN(DS_reg(context),DX_reg(context)));
+	    TRACE(int21, "(%s): DENYREAD changed to DENYALL\n",
+			 (char *)PTR_SEG_OFF_TO_LIN(DS_reg(context),DX_reg(context)));
 	  case 0x10:    /* DENYALL */  
 	    lock = LOCK_EX;
 	    break;
@@ -424,7 +423,7 @@
 	  CloseFile(context);
 	  AX_reg(context) = 0x0050;	/*File exists*/
 	  SET_CFLAG(context);
-	  dprintf_warn(int, "int21: extended open/create: failed because file exists \n");
+	  WARN(int21, "extended open/create: failed because file exists \n");
       }
       else if ((action & 0x07) == 2) 
       {
@@ -433,7 +432,7 @@
 	{
 		  BX_reg(context) = AX_reg(context);
 		  CloseFile(context);
-		  dprintf_warn(int, "int21: extended open/create: failed, trunc on ro file\n");
+		  WARN(int21, "extended open/create: failed, trunc on ro file\n");
 		  AX_reg(context) = 0x000C;	/*Access code invalid*/
 		  SET_CFLAG(context);
 	}
@@ -442,19 +441,19 @@
 		/* Shuffle arguments to call CloseFile while
 		 * preserving BX and DX */
 
-		dprintf_info(int, "int21: extended open/create: Closing before truncate\n");
+		TRACE(int21, "extended open/create: Closing before truncate\n");
 		BX_reg(context) = AX_reg(context);
 		CloseFile(context);
 		if (EFL_reg(context) & 0x0001) 
 		{
-		   dprintf_warn(int, "int21: extended open/create: close before trunc failed\n");
+		   WARN(int21, "extended open/create: close before trunc failed\n");
 		   AX_reg(context) = 0x0019;	/*Seek Error*/
 		   CX_reg(context) = 0;
 		   SET_CFLAG(context);
 		}
 		/* Shuffle arguments to call CreateFile */
 
-		dprintf_info(int, "int21: extended open/create: Truncating\n");
+		TRACE(int21, "extended open/create: Truncating\n");
 		AL_reg(context) = BL_reg(context);
 		/* CX is still the same */
 		DX_reg(context) = SI_reg(context);
@@ -462,7 +461,7 @@
 
 		if (EFL_reg(context) & 0x0001) 	/*no file open, flags set */
 		{
-		    dprintf_warn(int, "int21: extended open/create: trunc failed\n");
+		    WARN(int21, "extended open/create: trunc failed\n");
 		    return bExtendedError;
 		}
 		uReturnCX = 0x3;
@@ -479,19 +478,19 @@
       {
 	CX_reg(context) = 0;
 	SET_CFLAG(context);
-	dprintf_warn(int, "int21: extended open/create: failed, file dosen't exist\n");
+	WARN(int21, "extended open/create: failed, file dosen't exist\n");
       }
       else
       {
         /* Shuffle arguments to call CreateFile */
-        dprintf_info(int, "int21: extended open/create: Creating\n");
+        TRACE(int21, "extended open/create: Creating\n");
         AL_reg(context) = BL_reg(context);
         /* CX should still be the same */
         DX_reg(context) = SI_reg(context);
         bExtendedError = INT21_CreateFile(context);
         if (EFL_reg(context) & 0x0001)  /*no file open, flags set */
 	{
-  	    dprintf_warn(int, "int21: extended open/create: create failed\n");
+  	    WARN(int21, "extended open/create: create failed\n");
 	    return bExtendedError;
         }
         CX_reg(context) = 2;
@@ -507,7 +506,7 @@
     int drive;
     char *dirname = PTR_SEG_OFF_TO_LIN(DS_reg(context),DX_reg(context));
 
-    dprintf_info(int,"int21: changedir %s\n", dirname);
+    TRACE(int21,"changedir %s\n", dirname);
     if (dirname[0] && (dirname[1] == ':'))
     {
         drive = toupper(dirname[0]) - 'A';
@@ -605,7 +604,7 @@
 
         if ((AX_reg(context) = _lcreat_uniq( name, 0 )) != (WORD)HFILE_ERROR16)
         {
-            dprintf_info(int, "INT21_CreateTempFile: created %s\n", name );
+            TRACE(int21, "created %s\n", name );
             return TRUE;
         }
         if (DOS_ExtendedError != ER_FileExists) return FALSE;
@@ -800,6 +799,63 @@
      }
 } 
 
+SEGPTR INT21_GetListOfLists()
+{
+	static DOS_LISTOFLISTS *LOL;
+	static SEGPTR seg_LOL;
+
+/*
+Output of DOS 6.22:
+
+0133:0020                    6A 13-33 01 CC 00 33 01 59 00         j.3...3.Y.
+0133:0030  70 00 00 00 72 02 00 02-6D 00 33 01 00 00 2E 05   p...r...m.3.....
+0133:0040  00 00 FC 04 00 00 03 08-92 21 11 E0 04 80 C6 0D   .........!......
+0133:0050  CC 0D 4E 55 4C 20 20 20-20 20 00 00 00 00 00 00   ..NUL     ......
+0133:0060  00 4B BA C1 06 14 00 00-00 03 01 00 04 70 CE FF   .K...........p..
+0133:0070  FF 00 00 00 00 00 00 00-00 01 00 00 0D 05 00 00   ................
+0133:0080  00 FF FF 00 00 00 00 FE-00 00 F8 03 FF 9F 70 02   ..............p.
+0133:0090  D0 44 C8 FD D4 44 C8 FD-D4 44 C8 FD D0 44 C8 FD   .D...D...D...D..
+0133:00A0  D0 44 C8 FD D0 44                                 .D...D
+*/
+	if (!LOL) {
+		LOL = SEGPTR_ALLOC(sizeof(DOS_LISTOFLISTS));
+
+		LOL->CX_Int21_5e01		= 0x0;
+		LOL->LRU_count_FCB_cache	= 0x0;
+		LOL->LRU_count_FCB_open		= 0x0;
+		LOL->OEM_func_handler		= -1; /* not available */
+		LOL->INT21_offset		= 0x0;
+		LOL->sharing_retry_count	= sharing_retries; /* default value: 3 */
+		LOL->sharing_retry_delay	= sharing_pause; /* default value: 1 */
+		LOL->ptr_disk_buf		= 0x0;
+		LOL->offs_unread_CON		= 0x0;
+		LOL->seg_first_MCB		= 0x0;
+		LOL->ptr_first_DPB		= 0x0;
+		LOL->ptr_first_SysFileTable	= 0x0;
+		LOL->ptr_clock_dev_hdr		= 0x0;
+		LOL->ptr_CON_dev_hdr		= 0x0;
+		LOL->max_byte_per_sec		= 512;
+		LOL->ptr_disk_buf_info		= 0x0;
+		LOL->ptr_array_CDS		= 0x0;
+		LOL->ptr_sys_FCB		= 0x0;
+		LOL->nr_protect_FCB		= 0x0;
+		LOL->nr_block_dev		= 0x0;
+		LOL->nr_avail_drive_letters	= 26; /* A - Z */
+		LOL->nr_drives_JOINed		= 0x0;
+		LOL->ptr_spec_prg_names		= 0x0;
+		LOL->ptr_SETVER_prg_list	= 0x0; /* no SETVER list */
+		LOL->DOS_HIGH_A20_func_offs	= 0x0;
+		LOL->PSP_last_exec		= 0x0;
+		LOL->BUFFERS_val		= 99; /* maximum: 99 */
+		LOL->BUFFERS_nr_lookahead	= 8; /* maximum: 8 */
+		LOL->boot_drive			= 3; /* C: */
+		LOL->flag_DWORD_moves		= 0x01; /* i386+ */
+		LOL->size_extended_mem		= 0xf000; /* very high value */
+	}	
+	if (!seg_LOL) seg_LOL = SEGPTR_GET(LOL);
+	return seg_LOL+(WORD)&((DOS_LISTOFLISTS*)0)->ptr_first_DPB;
+}
+
 
 extern void LOCAL_PrintHeap (WORD ds);
 
@@ -810,7 +866,7 @@
 {
     BOOL32	bSetDOSExtendedError = FALSE;
 
-    dprintf_info(int, "int21: AX=%04x BX=%04x CX=%04x DX=%04x "
+    TRACE(int21, "AX=%04x BX=%04x CX=%04x DX=%04x "
                  "SI=%04x DI=%04x DS=%04x ES=%04x EFL=%08lx\n",
                  AX_reg(context), BX_reg(context), CX_reg(context),
                  DX_reg(context), SI_reg(context), DI_reg(context),
@@ -919,7 +975,7 @@
         {
             TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
             pTask->dta = PTR_SEG_OFF_TO_SEGPTR(DS_reg(context),DX_reg(context));
-            dprintf_info(int, "int21: Set DTA: %08lx\n", pTask->dta);
+            TRACE(int21, "Set DTA: %08lx\n", pTask->dta);
         }
         break;
 
@@ -1143,7 +1199,7 @@
 	    int	i;
 	    int	drive = DOS_GET_DRIVE(BL_reg(context));
 
-	    fprintf(stdnimp,"int21: program tried to write to block device control channel of drive %d:\n",drive);
+	    fprintf(stdnimp,"program tried to write to block device control channel of drive %d:\n",drive);
 	    for (i=0;i<CX_reg(context);i++)
 	    	fprintf(stdnimp,"%02x ",dataptr[i]);
 	    fprintf(stdnimp,"\n");
@@ -1285,9 +1341,12 @@
         break;
 
     case 0x52: /* "SYSVARS" - GET LIST OF LISTS */
-        ES_reg(context) = 0x0;
-        BX_reg(context) = 0x0;
-        INT_BARF( context, 0x21 );
+        {
+                SEGPTR lol;
+                lol = INT21_GetListOfLists();
+                ES_reg(context) = HIWORD(lol);
+                BX_reg(context) = LOWORD(lol);
+        }
         break;
 
     case 0x56: /* "RENAME" - RENAME FILE */
@@ -1583,9 +1642,9 @@
     case 0x70: /* MS-DOS 7 (Windows95) - ??? (country-specific?)*/
     case 0x72: /* MS-DOS 7 (Windows95) - ??? */
     case 0x73: /* MS-DOS 7 (Windows95) - DRIVE LOCKING ??? */
-        dprintf_info(int,"int21: windows95 function AX %04x\n",
+        TRACE(int21,"windows95 function AX %04x\n",
                     AX_reg(context));
-        dprintf_warn(int, "        returning unimplemented\n");
+        WARN(int21, "        returning unimplemented\n");
         SET_CFLAG(context);
         AL_reg(context) = 0;
         break;
@@ -1606,7 +1665,7 @@
 	SET_CFLAG(context);
     }
 
-    dprintf_info(int, "ret21: AX=%04x BX=%04x CX=%04x DX=%04x "
+    TRACE(int21, "returning: AX=%04x BX=%04x CX=%04x DX=%04x "
                  "SI=%04x DI=%04x DS=%04x ES=%04x EFL=%08lx\n",
                  AX_reg(context), BX_reg(context), CX_reg(context),
                  DX_reg(context), SI_reg(context), DI_reg(context),
diff --git a/msdos/int25.c b/msdos/int25.c
index d927394..6f16d88 100644
--- a/msdos/int25.c
+++ b/msdos/int25.c
@@ -42,7 +42,7 @@
         begin  = DX_reg(context);
         length = CX_reg(context);
     }
-    dprintf_info(int, "int25: abs diskread, drive %d, sector %ld, "
+    TRACE(int, "int25: abs diskread, drive %d, sector %ld, "
                  "count %ld, buffer %d\n",
                  AL_reg(context), begin, length, (int) dataptr);
 
diff --git a/msdos/int26.c b/msdos/int26.c
index b5ffe16..0ad1b41 100644
--- a/msdos/int26.c
+++ b/msdos/int26.c
@@ -42,7 +42,7 @@
         length = CX_reg(context);
     }
 		
-    dprintf_info(int,"int26: abs diskwrite, drive %d, sector %ld, "
+    TRACE(int,"int26: abs diskwrite, drive %d, sector %ld, "
                  "count %ld, buffer %d\n",
                  AL_reg(context), begin, length, (int) dataptr );
 
diff --git a/msdos/int2f.c b/msdos/int2f.c
index f31ad61..c2d2564 100644
--- a/msdos/int2f.c
+++ b/msdos/int2f.c
@@ -78,6 +78,8 @@
     case 0xbd:  /* some Novell network install check ??? */
         AX_reg(context) = 0xa5a5; /* pretend to have Novell IPX installed */
 	break;
+    case 0xfa:  /* Watcom debugger check, returns 0x666 if installed */
+        break;
     default:
         INT_BARF( context, 0x2f );
         break;
diff --git a/msdos/interrupts.c b/msdos/interrupts.c
index 6058be7..da6ff2a 100644
--- a/msdos/interrupts.c
+++ b/msdos/interrupts.c
@@ -35,7 +35,7 @@
  */
 void INT_SetHandler( BYTE intnum, FARPROC16 handler )
 {
-    dprintf_info(int, "Set interrupt vector %02x <- %04x:%04x\n",
+    TRACE(int, "Set interrupt vector %02x <- %04x:%04x\n",
                  intnum, HIWORD(handler), LOWORD(handler) );
     INT_Vectors[intnum] = handler;
 }
diff --git a/msdos/ioports.c b/msdos/ioports.c
index a63d305..b4924bd 100644
--- a/msdos/ioports.c
+++ b/msdos/ioports.c
@@ -215,7 +215,7 @@
                 case 2: res = inw( port ); break;
                 case 4: res = inl( port ); break;
                 default:
-                    fprintf( stderr, "IO_inport: invalid count %d\n", count);
+                    ERR(int, "invalid count %d\n", count);
             }
             iopl(0);
             return res;
@@ -223,7 +223,7 @@
     }
 #endif
 
-    dprintf_info(int, "IO: %d bytes from port 0x%02x\n", count, port );
+    TRACE(int, "%d bytes from port 0x%02x\n", count, port );
 
     while (count-- > 0)
     {
@@ -243,7 +243,7 @@
         port++;
         res = (res << 8) | b;
     }
-    dprintf_info(int, "  returning ( 0x%lx )\n", res );
+    TRACE(int, "  returning ( 0x%lx )\n", res );
     return res;
 }
 
@@ -255,7 +255,7 @@
 {
     BYTE b;
 
-    dprintf_info(int, "IO: 0x%lx (%d bytes) to port 0x%02x\n",
+    TRACE(int, "IO: 0x%lx (%d bytes) to port 0x%02x\n",
                  value, count, port );
 
 #ifdef DIRECT_IO_ACCESS
diff --git a/msdos/vxd.c b/msdos/vxd.c
index 8a3b77a..bc922e3 100644
--- a/msdos/vxd.c
+++ b/msdos/vxd.c
@@ -35,18 +35,18 @@
 
     /* taken from Ralf Brown's Interrupt List */
 
-    dprintf_info(vxd,"VxD: [%04x] PageFile\n", (UINT16)service );
+    TRACE(vxd,"[%04x] PageFile\n", (UINT16)service );
 
     switch(service)
     {
     case 0x00: /* get version, is this windows version? */
-	dprintf_info(vxd,"VxD PageFile: returning version\n");
+	TRACE(vxd,"returning version\n");
         AX_reg(context) = VXD_WinVersion();
 	RESET_CFLAG(context);
 	break;
 
     case 0x01: /* get swap file info */
-	dprintf_info(vxd,"VxD PageFile: returning swap file info\n");
+	TRACE(vxd,"VxD PageFile: returning swap file info\n");
 	AX_reg(context) = 0x00; /* paging disabled */
 	ECX_reg(context) = 0;   /* maximum size of paging file */	
 	/* FIXME: do I touch DS:SI or DS:DI? */
@@ -54,12 +54,12 @@
 	break;
 
     case 0x02: /* delete permanent swap on exit */
-	dprintf_info(vxd,"VxD PageFile: supposed to delete swap\n");
+	TRACE(vxd,"VxD PageFile: supposed to delete swap\n");
 	RESET_CFLAG(context);
 	break;
 
     case 0x03: /* current temporary swap file size */
-	dprintf_info(vxd,"VxD PageFile: what is current temp. swap size\n");
+	TRACE(vxd,"VxD PageFile: what is current temp. swap size\n");
 	RESET_CFLAG(context);
 	break;
 
@@ -80,12 +80,12 @@
 {
     unsigned	service = DX_reg(context);
 
-    dprintf_info(vxd,"VxD: [%04x] Shell\n", (UINT16)service);
+    TRACE(vxd,"[%04x] Shell\n", (UINT16)service);
 
     switch (service) /* Ralf Brown says EDX, but I use DX instead */
     {
     case 0x0000:
-	dprintf_info(vxd,"VxD Shell: returning version\n");
+	TRACE(vxd,"returning version\n");
         AX_reg(context) = VXD_WinVersion();
 	EBX_reg(context) = 1; /* system VM Handle */
 	break;
@@ -95,12 +95,12 @@
     case 0x0003:
     case 0x0004:
     case 0x0005:
-	dprintf_info(vxd,"VxD Shell: EDX = %08lx\n",EDX_reg(context));
+	TRACE(vxd,"VxD Shell: EDX = %08lx\n",EDX_reg(context));
 	VXD_BARF( context, "shell" );
 	break;
 
     case 0x0006: /* SHELL_Get_VM_State */
-	dprintf_info(vxd,"VxD Shell: returning VM state\n");
+	TRACE(vxd,"VxD Shell: returning VM state\n");
 	/* Actually we don't, not yet. We have to return a structure
          * and I am not to sure how to set it up and return it yet,
          * so for now let's do nothing. I can (hopefully) get this
@@ -126,7 +126,7 @@
     case 0x0015:
     case 0x0016:
     default:
- 	dprintf_info(vxd,"VxD Shell: EDX = %08lx\n",EDX_reg(context)); 
+ 	TRACE(vxd,"VxD Shell: EDX = %08lx\n",EDX_reg(context)); 
 	VXD_BARF( context, "shell");
 	break;
     }
@@ -140,12 +140,12 @@
 {
     unsigned	service = AX_reg(context);
 
-    dprintf_info(vxd,"VxD: [%04x] Comm\n", (UINT16)service);
+    TRACE(vxd,"[%04x] Comm\n", (UINT16)service);
 
     switch (service)
     {
     case 0x0000: /* get version */
-	dprintf_info(vxd,"VxD Comm: returning version\n");
+	TRACE(vxd,"returning version\n");
         AX_reg(context) = VXD_WinVersion();
 	RESET_CFLAG(context);
 	break;
@@ -165,7 +165,7 @@
 {
     unsigned service = AX_reg(context);
 
-    dprintf_info(vxd,"VxD: [%04x] Virtual Timer\n", (UINT16)service);
+    TRACE(vxd,"[%04x] Virtual Timer\n", (UINT16)service);
 
     switch(service)
     {
diff --git a/multimedia/audio.c b/multimedia/audio.c
index 768180f..cd55ce8 100644
--- a/multimedia/audio.c
+++ b/multimedia/audio.c
@@ -16,6 +16,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include "windows.h"
@@ -27,7 +28,11 @@
 #include "debug.h"
 
 #ifdef HAVE_OSS
+#ifdef HAVE_MACHINE_SOUNDCARD_H
+#include <machine/soundcard.h>
+#else /* HAVE_MACHINE_SOUNDCARD_H */
 #include <sys/soundcard.h>
+#endif /* HAVE_MACHINE_SOUNDCARD_H */
 
 #define SOUND_DEV "/dev/dsp"
 #define MIXER_DEV "/dev/mixer"
@@ -87,7 +92,7 @@
 static DWORD WAVE_NotifyClient(UINT16 wDevID, WORD wMsg, 
 				DWORD dwParam1, DWORD dwParam2)
 {
-	dprintf_info(mciwave,"WAVE_NotifyClient // wDevID = %04X wMsg = %d dwParm1 = %04lX dwParam2 = %04lX\n",wDevID, wMsg, dwParam1, dwParam2);
+	TRACE(mciwave,"wDevID = %04X wMsg = %d dwParm1 = %04lX dwParam2 = %04lX\n",wDevID, wMsg, dwParam1, dwParam2);
 
 	switch (wMsg) {
 	case WOM_OPEN:
@@ -103,7 +108,7 @@
 		WOutDev[wDevID].waveDesc.dwInstance, 
                 dwParam1, 
                 dwParam2)) {
-	    dprintf_warn(mciwave, "WAVE_NotifyClient // can't notify client !\n");
+	    WARN(mciwave, "can't notify client !\n");
 	    return MMSYSERR_NOERROR;
 	  }
 	  break;
@@ -117,7 +122,7 @@
 		WInDev[wDevID].waveDesc.dwCallBack, WInDev[wDevID].wFlags, 
 		WInDev[wDevID].waveDesc.hWave, wMsg, 
 		WInDev[wDevID].waveDesc.dwInstance, dwParam1, dwParam2)) {
-	    dprintf_warn(mciwave, "WAVE_NotifyClient // can't notify client !\n");
+	    WARN(mciwave, "can't notify client !\n");
 	    return MMSYSERR_NOERROR;
 	  }
 	  break;
@@ -137,7 +142,7 @@
 	DWORD		dwRet;
 	char		str[128];
 
-	dprintf_info(mciwave,"WAVE_mciOpen(%04X, %08lX, %p)\n", 
+	TRACE(mciwave,"(%04X, %08lX, %p)\n", 
 				wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 
@@ -156,11 +161,11 @@
 
 	MCIWavDev[wDevID].fInput = FALSE;
 
-	dprintf_info(mciwave,"WAVE_mciOpen // wDevID=%04X\n", wDevID);
-	dprintf_info(mciwave,"WAVE_mciOpen // before OPEN_ELEMENT\n");
+	TRACE(mciwave,"wDevID=%04X\n", wDevID);
+	TRACE(mciwave,"before OPEN_ELEMENT\n");
 	if (dwFlags & MCI_OPEN_ELEMENT) {
 		lpstrElementName = (LPSTR)PTR_SEG_TO_LIN(lpParms->lpstrElementName);
-		dprintf_info(mciwave,"WAVE_mciOpen // MCI_OPEN_ELEMENT '%s' !\n",
+		TRACE(mciwave,"MCI_OPEN_ELEMENT '%s' !\n",
 						lpstrElementName);
 		if ( lpstrElementName && (strlen(lpstrElementName) > 0)) {
 			strcpy(str, lpstrElementName);
@@ -168,14 +173,14 @@
 			MCIWavDev[wDevID].hFile = mmioOpen16(str, NULL, 
 				MMIO_ALLOCBUF | MMIO_READWRITE | MMIO_EXCLUSIVE);
 			if (MCIWavDev[wDevID].hFile == 0) {
-				dprintf_warn(mciwave, "WAVE_mciOpen // can't find file='%s' !\n", str);
+				WARN(mciwave, "can't find file='%s' !\n", str);
 				return MCIERR_FILE_NOT_FOUND;
 			}
 		}
 		else 
 			MCIWavDev[wDevID].hFile = 0;
 	}
-	dprintf_info(mciwave,"WAVE_mciOpen // hFile=%u\n", MCIWavDev[wDevID].hFile);
+	TRACE(mciwave,"hFile=%u\n", MCIWavDev[wDevID].hFile);
 	memcpy(&MCIWavDev[wDevID].openParms, lpParms, sizeof(MCI_WAVE_OPEN_PARMS16));
 	MCIWavDev[wDevID].wNotifyDeviceID = lpParms->wDeviceID;
 	lpWaveFormat = &MCIWavDev[wDevID].WaveFormat;
@@ -194,33 +199,29 @@
 		MMCKINFO	ckMainRIFF;
 		if (mmioDescend(MCIWavDev[wDevID].hFile, &ckMainRIFF, NULL, 0) != 0)
 			return MCIERR_INTERNAL;
-		dprintf_info(mciwave,
-				"WAVE_mciOpen // ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n",
-				(LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType,
-				ckMainRIFF.cksize);
+		TRACE(mciwave, "ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n",
+			     (LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType,
+			     ckMainRIFF.cksize);
 		if ((ckMainRIFF.ckid != FOURCC_RIFF) ||
 		    (ckMainRIFF.fccType != mmioFOURCC('W', 'A', 'V', 'E')))
 			return MCIERR_INTERNAL;
 		mmckInfo.ckid = mmioFOURCC('f', 'm', 't', ' ');
 		if (mmioDescend(MCIWavDev[wDevID].hFile, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK) != 0)
 			return MCIERR_INTERNAL;
-		dprintf_info(mciwave,
-				"WAVE_mciOpen // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
-				(LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType,
-				mmckInfo.cksize);
+		TRACE(mciwave, "Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
+			     (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType,
+			     mmckInfo.cksize);
 		if (mmioRead(MCIWavDev[wDevID].hFile, (HPSTR) lpWaveFormat,
 		    (long) sizeof(PCMWAVEFORMAT)) != (long) sizeof(PCMWAVEFORMAT))
 			return MCIERR_INTERNAL;
 		mmckInfo.ckid = mmioFOURCC('d', 'a', 't', 'a');
 		if (mmioDescend(MCIWavDev[wDevID].hFile, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK) != 0)
 			return MCIERR_INTERNAL;
-		dprintf_info(mciwave,
-				"WAVE_mciOpen // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
-				(LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType,
-				mmckInfo.cksize);
-		dprintf_info(mciwave,
-			"WAVE_mciOpen // nChannels=%d nSamplesPerSec=%ld\n",
-			lpWaveFormat->wf.nChannels, lpWaveFormat->wf.nSamplesPerSec);
+		TRACE(mciwave,"Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
+			     (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType,
+			     mmckInfo.cksize);
+		TRACE(mciwave, "nChannels=%d nSamplesPerSec=%ld\n",
+		     lpWaveFormat->wf.nChannels, lpWaveFormat->wf.nSamplesPerSec);
 		lpWaveFormat->wBitsPerSample = 0;
 	}
 	lpWaveFormat->wf.nAvgBytesPerSec = 
@@ -256,7 +257,7 @@
         DWORD		dwRet;
         WAVEOPENDESC	waveDesc;
 
-	dprintf_info(mciwave,"WAVE_mciCue(%u, %08lX, %p);\n", wDevID, dwParam, lpParms);
+	TRACE(mciwave,"(%u, %08lX, %p);\n", wDevID, dwParam, lpParms);
 
 /* always close elements ? */
 
@@ -294,8 +295,7 @@
 {
 	DWORD		dwRet;
 
-	dprintf_info(mciwave,
-			"WAVE_mciClose(%u, %08lX, %p);\n", wDevID, dwParam, lpParms);
+	TRACE(mciwave, "(%u, %08lX, %p);\n", wDevID, dwParam, lpParms);
 	MCIWavDev[wDevID].nUseCount--;
 	if (MCIWavDev[wDevID].nUseCount == 0) {
 	        if (MCIWavDev[wDevID].hFile != 0) {
@@ -324,41 +324,38 @@
 	LPWAVEHDR	lpWaveHdr;
 	DWORD		dwRet;
 
-	dprintf_info(mciwave,
-		 "WAVE_mciPlay(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(mciwave, "(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 
 	if (MCIWavDev[wDevID].fInput) {
-	        dprintf_warn(mciwave, "WAVE_mciPlay // cannot play on input device\n");
+	        WARN(mciwave, "cannot play on input device\n");
 		return MCIERR_NONAPPLICABLE_FUNCTION;
 	}
 
 	if (MCIWavDev[wDevID].hFile == 0) {
-                dprintf_warn(mciwave, "WAVE_mciPlay // can't find file='%08lx' !\n",
+                WARN(mciwave, "can't find file='%08lx' !\n",
                         MCIWavDev[wDevID].openParms.lpstrElementName);
 		return MCIERR_FILE_NOT_FOUND;
 	}
 	start = 1; 		end = 99999;
 	if (dwFlags & MCI_FROM) {
 		start = lpParms->dwFrom; 
-		dprintf_info(mciwave,
-				"WAVE_mciPlay // MCI_FROM=%d \n", start);
+		TRACE(mciwave, "MCI_FROM=%d \n", start);
 	}
 	if (dwFlags & MCI_TO) {
 		end = lpParms->dwTo;
-		dprintf_info(mciwave,"WAVE_mciPlay // MCI_TO=%d \n", end);
+		TRACE(mciwave,"MCI_TO=%d \n", end);
 	}
 #if 0
 	if (dwFlags & MCI_NOTIFY) {
-        dprintf_info(mciwave,
-	        "WAVE_mciPlay // MCI_NOTIFY %08lX !\n", lpParms->dwCallback);
+        TRACE(mciwave, "MCI_NOTIFY %08lX !\n", lpParms->dwCallback);
 		switch(fork()) {
 			case -1:
-				dprintf_warn(mciwave, "WAVE_mciPlay // Can't 'fork' process !\n");
+				WARN(mciwave, "Can't 'fork' process !\n");
 				break;
 			case 0:
 				break;         
 			default:
-				dprintf_info(mciwave,"WAVE_mciPlay // process started ! return to caller...\n");
+				TRACE(mciwave,"process started ! return to caller...\n");
 				return 0;
 			}
 		}
@@ -373,11 +370,11 @@
 	dwRet=wodMessage(wDevID,WODM_PREPARE,0,(DWORD)lpWaveHdr,sizeof(WAVEHDR));
 	while(TRUE) {
 		count = mmioRead(MCIWavDev[wDevID].hFile, lpWaveHdr->lpData, bufsize);
-		dprintf_info(mciwave,"WAVE_mciPlay // mmioRead bufsize=%ld count=%ld\n", bufsize, count);
+		TRACE(mciwave,"mmioRead bufsize=%ld count=%ld\n", bufsize, count);
 		if (count < 1) break;
 		lpWaveHdr->dwBufferLength = count;
 /*		lpWaveHdr->dwBytesRecorded = count; */
-		dprintf_info(mciwave,"WAVE_mciPlay // before WODM_WRITE lpWaveHdr=%p dwBufferLength=%lu dwBytesRecorded=%lu\n",
+		TRACE(mciwave,"before WODM_WRITE lpWaveHdr=%p dwBufferLength=%lu dwBytesRecorded=%lu\n",
 				lpWaveHdr, lpWaveHdr->dwBufferLength, lpWaveHdr->dwBytesRecorded);
 		dwRet=wodMessage(wDevID,WODM_WRITE,0,(DWORD)lpWaveHdr,sizeof(WAVEHDR));
 	}
@@ -388,7 +385,7 @@
 		lpWaveHdr->lpData = NULL;
 	}
 	if (dwFlags & MCI_NOTIFY) {
-		dprintf_info(mciwave,"WAVE_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
+		TRACE(mciwave,"MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
 	}
@@ -407,28 +404,26 @@
 	LPWAVEHDR		lpWaveHdr;
 	DWORD			dwRet;
 
-	dprintf_info(mciwave,
-		"WAVE_mciRecord(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(mciwave, "(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 
 	if (!MCIWavDev[wDevID].fInput) {
-	        dprintf_warn(mciwave, "WAVE_mciPlay // cannot record on output device\n");
+	        WARN(mciwave, "cannot record on output device\n");
 		return MCIERR_NONAPPLICABLE_FUNCTION;
 	}
 
 	if (MCIWavDev[wDevID].hFile == 0) {
-		dprintf_warn(mciwave, "WAVE_mciRecord // can't find file='%08lx' !\n", 
+		WARN(mciwave, "can't find file='%08lx' !\n", 
 				MCIWavDev[wDevID].openParms.lpstrElementName);
 		return MCIERR_FILE_NOT_FOUND;
 	}
 	start = 1; 	end = 99999;
 	if (dwFlags & MCI_FROM) {
 		start = lpParms->dwFrom; 
-		dprintf_info(mciwave,
-				"WAVE_mciRecord // MCI_FROM=%d \n", start);
+		TRACE(mciwave, "MCI_FROM=%d \n", start);
 	}
 	if (dwFlags & MCI_TO) {
 		end = lpParms->dwTo;
-		dprintf_info(mciwave,"WAVE_mciRecord // MCI_TO=%d \n", end);
+		TRACE(mciwave,"MCI_TO=%d \n", end);
 	}
 	bufsize = 64000;
 	lpWaveHdr = &MCIWavDev[wDevID].WaveHdr;
@@ -439,25 +434,24 @@
 	lpWaveHdr->dwFlags = 0L;
 	lpWaveHdr->dwLoops = 0L;
 	dwRet=widMessage(wDevID,WIDM_PREPARE,0,(DWORD)lpWaveHdr,sizeof(WAVEHDR));
-	dprintf_info(mciwave,"WAVE_mciRecord // after WIDM_PREPARE \n");
+	TRACE(mciwave,"after WIDM_PREPARE \n");
 	while(TRUE) {
 		lpWaveHdr->dwBytesRecorded = 0;
 		dwRet = widMessage(wDevID, WIDM_START, 0, 0L, 0L);
-		dprintf_info(mciwave,
-                    "WAVE_mciRecord // after WIDM_START lpWaveHdr=%p dwBytesRecorded=%lu\n",
-					lpWaveHdr, lpWaveHdr->dwBytesRecorded);
+		TRACE(mciwave, "after WIDM_START lpWaveHdr=%p dwBytesRecorded=%lu\n",
+			     lpWaveHdr, lpWaveHdr->dwBytesRecorded);
 		if (lpWaveHdr->dwBytesRecorded == 0) break;
 	}
-	dprintf_info(mciwave,"WAVE_mciRecord // before WIDM_UNPREPARE \n");
+	TRACE(mciwave,"before WIDM_UNPREPARE \n");
 	dwRet = widMessage(wDevID,WIDM_UNPREPARE,0,(DWORD)lpWaveHdr,sizeof(WAVEHDR));
-	dprintf_info(mciwave,"WAVE_mciRecord // after WIDM_UNPREPARE \n");
+	TRACE(mciwave,"after WIDM_UNPREPARE \n");
 	if (lpWaveHdr->lpData != NULL) {
 		GlobalUnlock16(hData);
 		GlobalFree16(hData);
 		lpWaveHdr->lpData = NULL;
 	}
 	if (dwFlags & MCI_NOTIFY) {
-	  dprintf_info(mciwave,"WAVE_mciRecord // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
+	  TRACE(mciwave,"MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
 	}
@@ -472,8 +466,7 @@
 {
         DWORD dwRet;
 
-	dprintf_info(mciwave,
-		"WAVE_mciStop(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(mciwave, "(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (MCIWavDev[wDevID].fInput)
 	  dwRet = widMessage(wDevID, WIDM_STOP, 0, dwFlags, (DWORD)lpParms);
@@ -491,8 +484,7 @@
 {
         DWORD dwRet;
 
-	dprintf_info(mciwave,
-		"WAVE_mciPause(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(mciwave, "(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (MCIWavDev[wDevID].fInput)
 	  dwRet = widMessage(wDevID, WIDM_PAUSE, 0, dwFlags, (DWORD)lpParms);
@@ -508,8 +500,7 @@
  */
 static DWORD WAVE_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
 {
-	dprintf_info(mciwave,
-		"WAVE_mciResume(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(mciwave, "(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	return 0;
 }
@@ -520,26 +511,23 @@
  */
 static DWORD WAVE_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
 {
-	dprintf_info(mciwave,
-		"WAVE_mciSet(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(mciwave, "(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
-	dprintf_info(mciwave,
-		 "WAVE_mciSet // dwTimeFormat=%08lX\n", lpParms->dwTimeFormat);
-	dprintf_info(mciwave,
-		 "WAVE_mciSet // dwAudio=%08lX\n", lpParms->dwAudio);
+	TRACE(mciwave, "dwTimeFormat=%08lX\n", lpParms->dwTimeFormat);
+	TRACE(mciwave, "dwAudio=%08lX\n", lpParms->dwAudio);
 	if (dwFlags & MCI_SET_TIME_FORMAT) {
 		switch (lpParms->dwTimeFormat) {
 		case MCI_FORMAT_MILLISECONDS:
-			dprintf_info(mciwave,	"WAVE_mciSet // MCI_FORMAT_MILLISECONDS !\n");
+			TRACE(mciwave, "MCI_FORMAT_MILLISECONDS !\n");
 			break;
 		case MCI_FORMAT_BYTES:
-			dprintf_info(mciwave, "WAVE_mciSet // MCI_FORMAT_BYTES !\n");
+			TRACE(mciwave, "MCI_FORMAT_BYTES !\n");
 			break;
 		case MCI_FORMAT_SAMPLES:
-			dprintf_info(mciwave,	"WAVE_mciSet // MCI_FORMAT_SAMPLES !\n");
+			TRACE(mciwave, "MCI_FORMAT_SAMPLES !\n");
 			break;
 		default:
-			dprintf_warn(mciwave,	"WAVE_mciSet // bad time format !\n");
+			WARN(mciwave, "bad time format !\n");
 			return MCIERR_BAD_TIME_FORMAT;
 		}
 	}
@@ -547,39 +535,36 @@
 	if (dwFlags & MCI_SET_DOOR_OPEN) return MCIERR_UNSUPPORTED_FUNCTION;
 	if (dwFlags & MCI_SET_DOOR_CLOSED) return MCIERR_UNSUPPORTED_FUNCTION;
 	if (dwFlags & MCI_SET_AUDIO) 
-	  dprintf_info(mciwave,"WAVE_mciSet // MCI_SET_AUDIO !\n");
+	  TRACE(mciwave,"MCI_SET_AUDIO !\n");
 	if (dwFlags && MCI_SET_ON) {
-	  dprintf_info(mciwave,"WAVE_mciSet // MCI_SET_ON !\n");
+	  TRACE(mciwave,"MCI_SET_ON !\n");
 	  if (dwFlags && MCI_SET_AUDIO_LEFT) 
-	    dprintf_info(mciwave,"WAVE_mciSet // MCI_SET_AUDIO_LEFT !\n");
+	    TRACE(mciwave,"MCI_SET_AUDIO_LEFT !\n");
 	  if (dwFlags && MCI_SET_AUDIO_RIGHT) 
-	    dprintf_info(mciwave,"WAVE_mciSet // MCI_SET_AUDIO_RIGHT !\n");
+	    TRACE(mciwave,"MCI_SET_AUDIO_RIGHT !\n");
 	}
 	if (dwFlags & MCI_SET_OFF) 
-	  dprintf_info(mciwave,"WAVE_mciSet // MCI_SET_OFF !\n");
+	  TRACE(mciwave,"MCI_SET_OFF !\n");
 	if (dwFlags & MCI_WAVE_INPUT) 
-	  dprintf_info(mciwave,"WAVE_mciSet // MCI_WAVE_INPUT !\n");
+	  TRACE(mciwave,"MCI_WAVE_INPUT !\n");
       	if (dwFlags & MCI_WAVE_OUTPUT) 
-	  dprintf_info(mciwave,"WAVE_mciSet // MCI_WAVE_OUTPUT !\n");
+	  TRACE(mciwave,"MCI_WAVE_OUTPUT !\n");
 	if (dwFlags & MCI_WAVE_SET_ANYINPUT) 
-	  dprintf_info(mciwave,"WAVE_mciSet // MCI_WAVE_SET_ANYINPUT !\n");
+	  TRACE(mciwave,"MCI_WAVE_SET_ANYINPUT !\n");
 	if (dwFlags & MCI_WAVE_SET_ANYOUTPUT) 
-	  dprintf_info(mciwave,"WAVE_mciSet // MCI_WAVE_SET_ANYOUTPUT !\n");
+	  TRACE(mciwave,"MCI_WAVE_SET_ANYOUTPUT !\n");
 	if (dwFlags & MCI_WAVE_SET_AVGBYTESPERSEC) 
-	  dprintf_info(mciwave,
-			  "WAVE_mciSet // MCI_WAVE_SET_AVGBYTESPERSEC !\n");
+	  TRACE(mciwave, "MCI_WAVE_SET_AVGBYTESPERSEC !\n");
 	if (dwFlags & MCI_WAVE_SET_BITSPERSAMPLE) 
-	  dprintf_info(mciwave,
-			  "WAVE_mciSet // MCI_WAVE_SET_BITSPERSAMPLE !\n");
+	  TRACE(mciwave, "MCI_WAVE_SET_BITSPERSAMPLE !\n");
 	if (dwFlags & MCI_WAVE_SET_BLOCKALIGN) 
-	  dprintf_info(mciwave,"WAVE_mciSet // MCI_WAVE_SET_BLOCKALIGN !\n");
+	  TRACE(mciwave,"MCI_WAVE_SET_BLOCKALIGN !\n");
 	if (dwFlags & MCI_WAVE_SET_CHANNELS) 
-	  dprintf_info(mciwave,"WAVE_mciSet // MCI_WAVE_SET_CHANNELS !\n");
+	  TRACE(mciwave,"MCI_WAVE_SET_CHANNELS !\n");
 	if (dwFlags & MCI_WAVE_SET_FORMATTAG) 
-	  dprintf_info(mciwave,"WAVE_mciSet // MCI_WAVE_SET_FORMATTAG !\n");
+	  TRACE(mciwave,"MCI_WAVE_SET_FORMATTAG !\n");
 	if (dwFlags & MCI_WAVE_SET_SAMPLESPERSEC) 
-	  dprintf_info(mciwave,
-			  "WAVE_mciSet // MCI_WAVE_SET_SAMPLESPERSEC !\n");
+	  TRACE(mciwave, "MCI_WAVE_SET_SAMPLESPERSEC !\n");
  	return 0;
 }
 
@@ -589,8 +574,7 @@
  */
 static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
 {
-	dprintf_info(mciwave,
-		"WAVE_mciStatus(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(mciwave, "(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (dwFlags & MCI_STATUS_ITEM) {
 		switch(lpParms->dwItem) {
@@ -608,7 +592,7 @@
 			lpParms->dwReturn = MCI_MODE_STOP;
 			break;
 		case MCI_STATUS_MEDIA_PRESENT:
-			dprintf_info(mciwave,"WAVE_mciStatus // MCI_STATUS_MEDIA_PRESENT !\n");
+			TRACE(mciwave,"MCI_STATUS_MEDIA_PRESENT !\n");
 			lpParms->dwReturn = TRUE;
 			break;
 		case MCI_STATUS_NUMBER_OF_TRACKS:
@@ -624,56 +608,56 @@
 			}
 			break;
 		case MCI_STATUS_READY:
-			dprintf_info(mciwave,"WAVE_mciStatus // MCI_STATUS_READY !\n");
+			TRACE(mciwave,"MCI_STATUS_READY !\n");
 			lpParms->dwReturn = TRUE;
 			break;
 		case MCI_STATUS_TIME_FORMAT:
-			dprintf_info(mciwave,"WAVE_mciStatus // MCI_STATUS_TIME_FORMAT !\n");
+			TRACE(mciwave,"MCI_STATUS_TIME_FORMAT !\n");
 			lpParms->dwReturn = MCI_FORMAT_MILLISECONDS;
 			break;
 		case MCI_WAVE_INPUT:
-			dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_INPUT !\n");
+			TRACE(mciwave,"MCI_WAVE_INPUT !\n");
 			lpParms->dwReturn = 0;
 			break;
 		case MCI_WAVE_OUTPUT:
-			dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_OUTPUT !\n");
+			TRACE(mciwave,"MCI_WAVE_OUTPUT !\n");
 			lpParms->dwReturn = 0;
 			break;
 		case MCI_WAVE_STATUS_AVGBYTESPERSEC:
-			dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_STATUS_AVGBYTESPERSEC !\n");
+			TRACE(mciwave,"MCI_WAVE_STATUS_AVGBYTESPERSEC !\n");
 			lpParms->dwReturn = 22050;
 			break;
 		case MCI_WAVE_STATUS_BITSPERSAMPLE:
-			dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_STATUS_BITSPERSAMPLE !\n");
+			TRACE(mciwave,"MCI_WAVE_STATUS_BITSPERSAMPLE !\n");
 			lpParms->dwReturn = 8;
 			break;
 		case MCI_WAVE_STATUS_BLOCKALIGN:
-			dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_STATUS_BLOCKALIGN !\n");
+			TRACE(mciwave,"MCI_WAVE_STATUS_BLOCKALIGN !\n");
 			lpParms->dwReturn = 1;
 			break;
 		case MCI_WAVE_STATUS_CHANNELS:
-			dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_STATUS_CHANNELS !\n");
+			TRACE(mciwave,"MCI_WAVE_STATUS_CHANNELS !\n");
 			lpParms->dwReturn = 1;
 			break;
 		case MCI_WAVE_STATUS_FORMATTAG:
-			dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_FORMATTAG !\n");
+			TRACE(mciwave,"MCI_WAVE_FORMATTAG !\n");
 			lpParms->dwReturn = WAVE_FORMAT_PCM;
 			break;
 		case MCI_WAVE_STATUS_LEVEL:
-			dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_STATUS_LEVEL !\n");
+			TRACE(mciwave,"MCI_WAVE_STATUS_LEVEL !\n");
 			lpParms->dwReturn = 0xAAAA5555;
 			break;
 		case MCI_WAVE_STATUS_SAMPLESPERSEC:
-			dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_STATUS_SAMPLESPERSEC !\n");
+			TRACE(mciwave,"MCI_WAVE_STATUS_SAMPLESPERSEC !\n");
 			lpParms->dwReturn = 22050;
 			break;
 		default:
-			dprintf_warn(mciwave,"WAVE_mciStatus // unknown command %08lX !\n", lpParms->dwItem);
+			WARN(mciwave,"unknown command %08lX !\n", lpParms->dwItem);
 			return MCIERR_UNRECOGNIZED_COMMAND;
 		}
 	}
 	if (dwFlags & MCI_NOTIFY) {
-		dprintf_info(mciwave,"WAVE_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
+		TRACE(mciwave,"MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
 	}
@@ -686,8 +670,7 @@
 static DWORD WAVE_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, 
 					LPMCI_GETDEVCAPS_PARMS lpParms)
 {
-	dprintf_info(mciwave,
-		"WAVE_mciGetDevCaps(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(mciwave, "(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (dwFlags & MCI_GETDEVCAPS_ITEM) {
 		switch(lpParms->dwItem) {
@@ -736,8 +719,7 @@
  */
 static DWORD WAVE_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpParms)
 {
-	dprintf_info(mciwave,
-		"WAVE_mciInfo(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(mciwave, "(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	lpParms->lpstrReturn = NULL;
 	switch(dwFlags) {
@@ -779,8 +761,7 @@
 	int	dsp_stereo = 1;
 	int	bytespersmpl;
 
-	dprintf_info(mciwave,
-		   "wodGetDevCaps(%u, %p, %lu);\n", wDevID, lpCaps, dwSize);
+	TRACE(mciwave, "(%u, %p, %lu);\n", wDevID, lpCaps, dwSize);
 	if (lpCaps == NULL) return MMSYSERR_NOTENABLED;
 	if (access(SOUND_DEV,0) != 0) return MMSYSERR_NOTENABLED;
 	audio = open (SOUND_DEV, O_WRONLY, 0);
@@ -834,8 +815,7 @@
 		}
 	}
 	close(audio);
-	dprintf_info(mciwave,
-		"wodGetDevCaps // dwFormats = %08lX\n", lpCaps->dwFormats);
+	TRACE(mciwave, "dwFormats = %08lX\n", lpCaps->dwFormats);
 	return MMSYSERR_NOERROR;
 }
 
@@ -848,44 +828,43 @@
 	int 	 audio,abuf_size,smplrate,samplesize,dsp_stereo;
 	LPWAVEFORMAT	lpFormat;
 
-	dprintf_info(mciwave,
-		"wodOpen(%u, %p, %08lX);\n", wDevID, lpDesc, dwFlags);
+	TRACE(mciwave, "(%u, %p, %08lX);\n", wDevID, lpDesc, dwFlags);
 	if (lpDesc == NULL) {
-		dprintf_warn(mciwave, "Linux 'wodOpen' // Invalid Parameter !\n");
+		WARN(mciwave, "Invalid Parameter !\n");
 		return MMSYSERR_INVALPARAM;
 	}
 	if (wDevID >= MAX_WAVOUTDRV) {
-		dprintf_info(mciwave,"Linux 'wodOpen' // MAX_WAVOUTDRV reached !\n");
+		TRACE(mciwave,"MAX_WAVOUTDRV reached !\n");
 		return MMSYSERR_ALLOCATED;
 	}
 	WOutDev[wDevID].unixdev = 0;
 	if (access(SOUND_DEV,0) != 0) return MMSYSERR_NOTENABLED;
 	audio = open (SOUND_DEV, O_WRONLY, 0);
 	if (audio == -1) {
-		dprintf_warn(mciwave, "Linux 'wodOpen' // can't open !\n");
+		WARN(mciwave, "can't open !\n");
 		return MMSYSERR_ALLOCATED ;
 	}
 	IOCTL(audio, SNDCTL_DSP_GETBLKSIZE, abuf_size);
 	if (abuf_size < 1024 || abuf_size > 65536) {
 		if (abuf_size == -1)
-			dprintf_warn(mciwave, "Linux 'wodOpen' // IOCTL can't 'SNDCTL_DSP_GETBLKSIZE' !\n");
+			WARN(mciwave, "IOCTL can't 'SNDCTL_DSP_GETBLKSIZE' !\n");
 		else
-			dprintf_warn(mciwave, "Linux 'wodOpen' // SNDCTL_DSP_GETBLKSIZE Invalid bufsize !\n");
+			WARN(mciwave, "SNDCTL_DSP_GETBLKSIZE Invalid bufsize !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	WOutDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK);
 	switch(WOutDev[wDevID].wFlags) {
 	case DCB_NULL:
-		dprintf_info(mciwave,	"Linux 'wodOpen' // CALLBACK_NULL !\n");
+		TRACE(mciwave, "CALLBACK_NULL !\n");
 		break;
 	case DCB_WINDOW:
-		dprintf_info(mciwave,	"Linux 'wodOpen' // CALLBACK_WINDOW !\n");
+		TRACE(mciwave, "CALLBACK_WINDOW !\n");
 		break;
 	case DCB_TASK:
-		dprintf_info(mciwave,	"Linux 'wodOpen' // CALLBACK_TASK !\n");
+		TRACE(mciwave, "CALLBACK_TASK !\n");
 		break;
 	case DCB_FUNCTION:
-		dprintf_info(mciwave,	"Linux 'wodOpen' // CALLBACK_FUNCTION !\n");
+		TRACE(mciwave, "CALLBACK_FUNCTION !\n");
 		break;
 	}
 	WOutDev[wDevID].lpQueueHdr = NULL;
@@ -894,23 +873,23 @@
 	WOutDev[wDevID].bufsize = abuf_size;
 	/* FIXME: copy lpFormat too? */
 	memcpy(&WOutDev[wDevID].waveDesc, lpDesc, sizeof(WAVEOPENDESC));
-	dprintf_info(mciwave,"Linux 'wodOpen' // lpDesc->lpFormat = %p\n",lpDesc->lpFormat);
+	TRACE(mciwave,"lpDesc->lpFormat = %p\n",lpDesc->lpFormat);
         lpFormat = lpDesc->lpFormat; 
-	dprintf_info(mciwave,"Linux 'wodOpen' // lpFormat = %p\n",lpFormat);
+	TRACE(mciwave,"lpFormat = %p\n",lpFormat);
 	if (lpFormat->wFormatTag != WAVE_FORMAT_PCM) {
-		dprintf_warn(mciwave,"Linux 'wodOpen' // Bad format %04X !\n",
-				lpFormat->wFormatTag);
-		dprintf_warn(mciwave,"Linux 'wodOpen' // Bad nChannels %d !\n",
-				lpFormat->nChannels);
-		dprintf_warn(mciwave,"Linux 'wodOpen' // Bad nSamplesPerSec %ld !\n",
-				lpFormat->nSamplesPerSec);
+		WARN(mciwave,"Bad format %04X !\n",
+			     lpFormat->wFormatTag);
+		WARN(mciwave,"Bad nChannels %d !\n",
+			     lpFormat->nChannels);
+		WARN(mciwave,"Bad nSamplesPerSec %ld !\n",
+			     lpFormat->nSamplesPerSec);
 		return WAVERR_BADFORMAT;
 	}
 	memcpy(&WOutDev[wDevID].Format, lpFormat, sizeof(PCMWAVEFORMAT));
 	if (WOutDev[wDevID].Format.wf.nChannels == 0) return WAVERR_BADFORMAT;
 	if (WOutDev[wDevID].Format.wf.nSamplesPerSec == 0) return WAVERR_BADFORMAT;
-	dprintf_info(mciwave,"Linux 'wodOpen' // wBitsPerSample=%u !\n",
-				WOutDev[wDevID].Format.wBitsPerSample);
+	TRACE(mciwave,"wBitsPerSample=%u !\n",
+		     WOutDev[wDevID].Format.wBitsPerSample);
 	if (WOutDev[wDevID].Format.wBitsPerSample == 0) {
 		WOutDev[wDevID].Format.wBitsPerSample = 8 *
 		(WOutDev[wDevID].Format.wf.nAvgBytesPerSec /
@@ -923,16 +902,16 @@
 	IOCTL(audio, SNDCTL_DSP_SPEED, smplrate);
 	IOCTL(audio, SNDCTL_DSP_SAMPLESIZE, samplesize);
 	IOCTL(audio, SNDCTL_DSP_STEREO, dsp_stereo);
-	dprintf_info(mciwave,"Linux 'wodOpen' // wBitsPerSample=%u !\n",
-				WOutDev[wDevID].Format.wBitsPerSample);
-	dprintf_info(mciwave,"Linux 'wodOpen' // nAvgBytesPerSec=%lu !\n",
-				WOutDev[wDevID].Format.wf.nAvgBytesPerSec);
-	dprintf_info(mciwave,"Linux 'wodOpen' // nSamplesPerSec=%lu !\n",
-				WOutDev[wDevID].Format.wf.nSamplesPerSec);
-	dprintf_info(mciwave,"Linux 'wodOpen' // nChannels=%u !\n",
-				WOutDev[wDevID].Format.wf.nChannels);
+	TRACE(mciwave,"wBitsPerSample=%u !\n",
+		     WOutDev[wDevID].Format.wBitsPerSample);
+	TRACE(mciwave,"nAvgBytesPerSec=%lu !\n",
+		     WOutDev[wDevID].Format.wf.nAvgBytesPerSec);
+	TRACE(mciwave,"nSamplesPerSec=%lu !\n",
+		     WOutDev[wDevID].Format.wf.nSamplesPerSec);
+	TRACE(mciwave,"nChannels=%u !\n",
+		     WOutDev[wDevID].Format.wf.nChannels);
 	if (WAVE_NotifyClient(wDevID, WOM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) {
-		dprintf_warn(mciwave, "Linux 'wodOpen' // can't notify client !\n");
+		WARN(mciwave, "can't notify client !\n");
 		return MMSYSERR_INVALPARAM;
 	}
 	return MMSYSERR_NOERROR;
@@ -943,14 +922,14 @@
  */
 static DWORD wodClose(WORD wDevID)
 {
-	dprintf_info(mciwave,"wodClose(%u);\n", wDevID);
+	TRACE(mciwave,"(%u);\n", wDevID);
 	if (wDevID > MAX_WAVOUTDRV) return MMSYSERR_INVALPARAM;
 	if (WOutDev[wDevID].unixdev == 0) {
-		dprintf_warn(mciwave, "Linux 'wodClose' // can't close !\n");
+		WARN(mciwave, "can't close !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	if (WOutDev[wDevID].lpQueueHdr != NULL) {
-	        dprintf_warn(mciwave, "linux 'wodclose' // still buffers open !\n");
+	        WARN(mciwave, "still buffers open !\n");
 		/* Don't care. Who needs those buffers anyway */
 		/*return WAVERR_STILLPLAYING; */
 	}
@@ -959,7 +938,7 @@
 	WOutDev[wDevID].bufsize = 0;
 	WOutDev[wDevID].lpQueueHdr = NULL;
 	if (WAVE_NotifyClient(wDevID, WOM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) {
-		dprintf_warn(mciwave, "Linux 'wodClose' // can't notify client !\n");
+		WARN(mciwave, "can't notify client !\n");
 		return MMSYSERR_INVALPARAM;
 	}
 	return MMSYSERR_NOERROR;
@@ -976,9 +955,9 @@
 	LPSTR	        lpData;
 	LPWAVEHDR	xwavehdr;
 
-	dprintf_info(mciwave,"wodWrite(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize);
+	TRACE(mciwave,"(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize);
 	if (WOutDev[wDevID].unixdev == 0) {
-        dprintf_warn(mciwave, "Linux 'wodWrite' // can't play !\n");
+        WARN(mciwave, "can't play !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	if (lpWaveHdr->lpData == NULL) return WAVERR_UNPREPARED;
@@ -986,15 +965,15 @@
 	if (lpWaveHdr->dwFlags & WHDR_INQUEUE) return WAVERR_STILLPLAYING;
 	lpWaveHdr->dwFlags &= ~WHDR_DONE;
 	lpWaveHdr->dwFlags |= WHDR_INQUEUE;
-	dprintf_info(mciwave,
-		"wodWrite() // dwBufferLength %lu !\n", lpWaveHdr->dwBufferLength);
-	dprintf_info(mciwave,
-		"wodWrite() // WOutDev[%u].unixdev %u !\n", wDevID, WOutDev[wDevID].unixdev);
+	TRACE(mciwave, "dwBufferLength %lu !\n", 
+		     lpWaveHdr->dwBufferLength);
+	TRACE(mciwave, "WOutDev[%u].unixdev %u !\n", 
+		     wDevID, WOutDev[wDevID].unixdev);
 	lpData = lpWaveHdr->lpData;
 	count = write (WOutDev[wDevID].unixdev, lpData, lpWaveHdr->dwBufferLength);
-	dprintf_info(mciwave,"wodWrite()//write returned count %u !\n",count);
+	TRACE(mciwave,"write returned count %u !\n",count);
 	if (count != lpWaveHdr->dwBufferLength) {
-		dprintf_warn(mciwave, "Linux 'wodWrite' // error writting !\n");
+		WARN(mciwave, " error writting !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	WOutDev[wDevID].dwTotalPlayed += count;
@@ -1006,14 +985,14 @@
 		memcpy(xwavehdr,lpWaveHdr,sizeof(WAVEHDR));
 		xwavehdr->lpData = (LPBYTE)xwavehdr->reserved;
 		if (WAVE_NotifyClient(wDevID, WOM_DONE, (DWORD)SEGPTR_GET(xwavehdr), count) != MMSYSERR_NOERROR) {
-			dprintf_warn(mciwave, "Linux 'wodWrite' // can't notify client !\n");
+			WARN(mciwave, "can't notify client !\n");
 			SEGPTR_FREE(xwavehdr);
 			return MMSYSERR_INVALPARAM;
 		}
 		SEGPTR_FREE(xwavehdr);
 	} else {
 		if (WAVE_NotifyClient(wDevID, WOM_DONE, (DWORD)lpWaveHdr, count) != MMSYSERR_NOERROR) {
-			dprintf_warn(mciwave, "Linux 'wodWrite' // can't notify client !\n");
+			WARN(mciwave, "can't notify client !\n");
 			return MMSYSERR_INVALPARAM;
 		}
 	}
@@ -1025,10 +1004,9 @@
  */
 static DWORD wodPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
 {
-	dprintf_info(mciwave,
-		"wodPrepare(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize);
+	TRACE(mciwave, "(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize);
 	if (WOutDev[wDevID].unixdev == 0) {
-		dprintf_warn(mciwave, "Linux 'wodPrepare' // can't prepare !\n");
+		WARN(mciwave, "can't prepare !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	/* don't append to queue, wodWrite does that */
@@ -1045,10 +1023,9 @@
  */
 static DWORD wodUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
 {
-	dprintf_info(mciwave,
-		"wodUnprepare(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize);
+	TRACE(mciwave, "(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize);
 	if (WOutDev[wDevID].unixdev == 0) {
-		dprintf_warn(mciwave, "Linux 'wodUnprepare' // can't unprepare !\n");
+		WARN(mciwave, "can't unprepare !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	if (lpWaveHdr->dwFlags & WHDR_INQUEUE)
@@ -1056,8 +1033,7 @@
 	
 	lpWaveHdr->dwFlags &= ~WHDR_PREPARED;
 	lpWaveHdr->dwFlags |= WHDR_DONE;
-	dprintf_info(mciwave,
-		"Linux 'wodUnprepare' // all headers unprepared !\n");
+	TRACE(mciwave, "all headers unprepared !\n");
 	return MMSYSERR_NOERROR;
 }
 
@@ -1066,14 +1042,14 @@
  */
 static DWORD wodRestart(WORD wDevID)
 {
-	dprintf_info(mciwave,"wodRestart(%u);\n", wDevID);
+	TRACE(mciwave,"(%u);\n", wDevID);
 	if (WOutDev[wDevID].unixdev == 0) {
-		dprintf_warn(mciwave, "Linux 'wodRestart' // can't restart !\n");
+		WARN(mciwave, "can't restart !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	/* FIXME: is NotifyClient with WOM_DONE right ? (Comet Busters 1.3.3 needs this notification) */
        	if (WAVE_NotifyClient(wDevID, WOM_DONE, 0L, 0L) != MMSYSERR_NOERROR) {
-               	dprintf_warn(mciwave, "Linux 'wodRestart' // can't notify client !\n");
+               	WARN(mciwave, "can't notify client !\n");
                	return MMSYSERR_INVALPARAM;
         }
 
@@ -1085,9 +1061,9 @@
  */
 static DWORD wodReset(WORD wDevID)
 {
-	dprintf_info(mciwave,"wodReset(%u);\n", wDevID);
+	TRACE(mciwave,"(%u);\n", wDevID);
 	if (WOutDev[wDevID].unixdev == 0) {
-		dprintf_warn(mciwave, "Linux 'wodReset' // can't reset !\n");
+		WARN(mciwave, "can't reset !\n");
 		return MMSYSERR_NOTENABLED;
 		}
 	return MMSYSERR_NOERROR;
@@ -1100,35 +1076,35 @@
 static DWORD wodGetPosition(WORD wDevID, LPMMTIME16 lpTime, DWORD uSize)
 {
 	int		time;
-	dprintf_info(mciwave,"wodGetPosition(%u, %p, %lu);\n", wDevID, lpTime, uSize);
+	TRACE(mciwave,"(%u, %p, %lu);\n", wDevID, lpTime, uSize);
 	if (WOutDev[wDevID].unixdev == 0) {
-		dprintf_warn(mciwave, "Linux 'wodGetPosition' // can't get pos !\n");
+		WARN(mciwave, "can't get pos !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	if (lpTime == NULL)	return MMSYSERR_INVALPARAM;
-	dprintf_info(mciwave,"wodGetPosition // wType=%04X !\n", 
+	TRACE(mciwave,"wType=%04X !\n", 
 			lpTime->wType);
-	dprintf_info(mciwave,"wodGetPosition // wBitsPerSample=%u\n",
+	TRACE(mciwave,"wBitsPerSample=%u\n",
 			WOutDev[wDevID].Format.wBitsPerSample); 
-	dprintf_info(mciwave,"wodGetPosition // nSamplesPerSec=%lu\n",
+	TRACE(mciwave,"nSamplesPerSec=%lu\n",
 			WOutDev[wDevID].Format.wf.nSamplesPerSec); 
-	dprintf_info(mciwave,"wodGetPosition // nChannels=%u\n",
+	TRACE(mciwave,"nChannels=%u\n",
 			WOutDev[wDevID].Format.wf.nChannels); 
-	dprintf_info(mciwave,"wodGetPosition // nAvgBytesPerSec=%lu\n",
+	TRACE(mciwave,"nAvgBytesPerSec=%lu\n",
 			WOutDev[wDevID].Format.wf.nAvgBytesPerSec); 
 	switch(lpTime->wType) {
 	case TIME_BYTES:
 		lpTime->u.cb = WOutDev[wDevID].dwTotalPlayed;
-		dprintf_info(mciwave,"wodGetPosition // TIME_BYTES=%lu\n", lpTime->u.cb);
+		TRACE(mciwave,"TIME_BYTES=%lu\n", lpTime->u.cb);
 		break;
 	case TIME_SAMPLES:
-		dprintf_info(mciwave,"wodGetPosition // dwTotalPlayed=%lu\n", 
+		TRACE(mciwave,"dwTotalPlayed=%lu\n", 
 				WOutDev[wDevID].dwTotalPlayed);
-		dprintf_info(mciwave,"wodGetPosition // wBitsPerSample=%u\n", 
+		TRACE(mciwave,"wBitsPerSample=%u\n", 
 				WOutDev[wDevID].Format.wBitsPerSample);
 		lpTime->u.sample = WOutDev[wDevID].dwTotalPlayed * 8 /
 					WOutDev[wDevID].Format.wBitsPerSample;
-		dprintf_info(mciwave,"wodGetPosition // TIME_SAMPLES=%lu\n", lpTime->u.sample);
+		TRACE(mciwave,"TIME_SAMPLES=%lu\n", lpTime->u.sample);
 		break;
 	case TIME_SMPTE:
 		time = WOutDev[wDevID].dwTotalPlayed /
@@ -1141,18 +1117,18 @@
 		time -= lpTime->u.smpte.sec * 30;
 		lpTime->u.smpte.frame = time;
 		lpTime->u.smpte.fps = 30;
-		dprintf_info(mciwave,
+		TRACE(mciwave,
 		  "wodGetPosition // TIME_SMPTE=%02u:%02u:%02u:%02u\n",
 		  lpTime->u.smpte.hour, lpTime->u.smpte.min,
 		  lpTime->u.smpte.sec, lpTime->u.smpte.frame);
 		break;
 	default:
-		dprintf_fixme(mciwave, "wodGetPosition() format not supported ! use TIME_MS !\n");
+		FIXME(mciwave, "wodGetPosition() format %d not supported ! use TIME_MS !\n",lpTime->wType);
 		lpTime->wType = TIME_MS;
 	case TIME_MS:
 		lpTime->u.ms = WOutDev[wDevID].dwTotalPlayed /
 				(WOutDev[wDevID].Format.wf.nAvgBytesPerSec / 1000);
-		dprintf_info(mciwave,"wodGetPosition // TIME_MS=%lu\n", lpTime->u.ms);
+		TRACE(mciwave,"wodGetPosition // TIME_MS=%lu\n", lpTime->u.ms);
 		break;
 	}
 	return MMSYSERR_NOERROR;
@@ -1165,20 +1141,20 @@
 {
 	int 	mixer;
 	int		volume, left, right;
-	dprintf_info(mciwave,"wodGetVolume(%u, %p);\n", wDevID, lpdwVol);
+	TRACE(mciwave,"(%u, %p);\n", wDevID, lpdwVol);
 	if (lpdwVol == NULL) return MMSYSERR_NOTENABLED;
 	if ((mixer = open(MIXER_DEV, O_RDONLY)) < 0) {
-		dprintf_warn(mciwave, "Linux 'wodGetVolume' // mixer device not available !\n");
+		WARN(mciwave, "mixer device not available !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	if (ioctl(mixer, SOUND_MIXER_READ_PCM, &volume) == -1) {
-		dprintf_warn(mciwave, "Linux 'wodGetVolume' // unable read mixer !\n");
+		WARN(mciwave, "unable read mixer !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	close(mixer);
 	left = volume & 0x7F;
 	right = (volume >> 8) & 0x7F;
-	dprintf_info(mciwave,"Linux 'wodGetVolume' // left=%d right=%d !\n", left, right);
+	TRACE(mciwave,"left=%d right=%d !\n", left, right);
 	*lpdwVol = MAKELONG(left << 9, right << 9);
 	return MMSYSERR_NOERROR;
 }
@@ -1191,15 +1167,15 @@
 {
 	int 	mixer;
 	int		volume;
-	dprintf_info(mciwave,"wodSetVolume(%u, %08lX);\n", wDevID, dwParam);
+	TRACE(mciwave,"(%u, %08lX);\n", wDevID, dwParam);
 	volume = (LOWORD(dwParam) >> 9 & 0x7F) + 
 		((HIWORD(dwParam) >> 9  & 0x7F) << 8);
 	if ((mixer = open(MIXER_DEV, O_WRONLY)) < 0) {
-		dprintf_warn(mciwave,	"Linux 'wodSetVolume' // mixer device not available !\n");
+		WARN(mciwave,	"mixer device not available !\n");
 		return MMSYSERR_NOTENABLED;
 		}
     if (ioctl(mixer, SOUND_MIXER_WRITE_PCM, &volume) == -1) {
-		dprintf_warn(mciwave, "Linux 'wodSetVolume' // unable set mixer !\n");
+		WARN(mciwave, "unable set mixer !\n");
 		return MMSYSERR_NOTENABLED;
 		}
 	close(mixer);
@@ -1212,7 +1188,8 @@
 DWORD wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser, 
 					DWORD dwParam1, DWORD dwParam2)
 {
-	dprintf_info(mciwave,"wodMessage(%u, %04X, %08lX, %08lX, %08lX);\n",
+  int audio;
+	TRACE(mciwave,"wodMessage(%u, %04X, %08lX, %08lX, %08lX);\n",
 			wDevID, wMsg, dwUser, dwParam1, dwParam2);
         switch(wMsg) {
 	case WODM_OPEN:
@@ -1236,7 +1213,15 @@
 	case WODM_GETDEVCAPS:
 		return wodGetDevCaps(wDevID,(LPWAVEOUTCAPS16)dwParam1,dwParam2);
 	case WODM_GETNUMDEVS:
-		return 1L;
+	  /* FIXME: For now, only one sound device (SOUND_DEV) is allowed */
+	  audio = open (SOUND_DEV, O_WRONLY, 0);
+	  if (audio == -1)
+	    if (errno == EBUSY)
+	      return 1;
+	    else
+	      return 0;
+	  close (audio);
+	  return 1;
 	case WODM_GETPITCH:
 		return MMSYSERR_NOTSUPPORTED;
 	case WODM_SETPITCH:
@@ -1254,7 +1239,7 @@
 	case WODM_RESET:
 		return wodReset(wDevID);
 	default:
-		dprintf_warn(mciwave,"wodMessage // unknown message !\n");
+		WARN(mciwave,"unknown message !\n");
 	}
 	return MMSYSERR_NOTSUPPORTED;
 }
@@ -1269,8 +1254,7 @@
 {
 	int 	audio,smplrate,samplesize=16,dsp_stereo=1,bytespersmpl;
 
-	dprintf_info(mciwave,
-		"widGetDevCaps(%u, %p, %lu);\n", wDevID, lpCaps, dwSize);
+	TRACE(mciwave, "(%u, %p, %lu);\n", wDevID, lpCaps, dwSize);
 	if (lpCaps == NULL) return MMSYSERR_NOTENABLED;
 	if (access(SOUND_DEV,0) != 0) return MMSYSERR_NOTENABLED;
 	audio = open (SOUND_DEV, O_RDONLY, 0);
@@ -1321,8 +1305,7 @@
 		}
 	}
 	close(audio);
-	dprintf_info(mciwave,
-		"widGetDevCaps // dwFormats = %08lX\n", lpCaps->dwFormats);
+	TRACE(mciwave, "dwFormats = %08lX\n", lpCaps->dwFormats);
 	return MMSYSERR_NOERROR;
 }
 
@@ -1335,43 +1318,43 @@
 	int 		audio,abuf_size,smplrate,samplesize,dsp_stereo;
 	LPWAVEFORMAT	lpFormat;
 
-	dprintf_info(mciwave, "widOpen(%u, %p, %08lX);\n", wDevID, lpDesc, dwFlags);
+	TRACE(mciwave, "(%u, %p, %08lX);\n", wDevID, lpDesc, dwFlags);
 	if (lpDesc == NULL) {
-		dprintf_warn(mciwave, "Linux 'widOpen' // Invalid Parameter !\n");
+		WARN(mciwave, "Invalid Parameter !\n");
 		return MMSYSERR_INVALPARAM;
 	}
 	if (wDevID >= MAX_WAVINDRV) {
-		dprintf_info(mciwave,"Linux 'widOpen' // MAX_WAVINDRV reached !\n");
+		TRACE(mciwave,"MAX_WAVINDRV reached !\n");
 		return MMSYSERR_ALLOCATED;
 	}
 	WInDev[wDevID].unixdev = 0;
 	if (access(SOUND_DEV,0) != 0) return MMSYSERR_NOTENABLED;
 	audio = open (SOUND_DEV, O_RDONLY, 0);
 	if (audio == -1) {
-		dprintf_warn(mciwave,"Linux 'widOpen' // can't open !\n");
+		WARN(mciwave,"can't open !\n");
 		return MMSYSERR_ALLOCATED;
 	}
 	IOCTL(audio, SNDCTL_DSP_GETBLKSIZE, abuf_size);
 	if (abuf_size < 1024 || abuf_size > 65536) {
 		if (abuf_size == -1)
-			dprintf_warn(mciwave, "Linux 'widOpen' // IOCTL can't 'SNDCTL_DSP_GETBLKSIZE' !\n");
+			WARN(mciwave, "IOCTL can't 'SNDCTL_DSP_GETBLKSIZE' !\n");
 		else
-			dprintf_warn(mciwave, "Linux 'widOpen' // SNDCTL_DSP_GETBLKSIZE Invalid bufsize !\n");
+			WARN(mciwave, "SNDCTL_DSP_GETBLKSIZE Invalid bufsize !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	WInDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK);
 	switch(WInDev[wDevID].wFlags) {
 	case DCB_NULL:
-		dprintf_info(mciwave,"Linux 'widOpen' // CALLBACK_NULL!\n");
+		TRACE(mciwave,"CALLBACK_NULL!\n");
 		break;
 	case DCB_WINDOW:
-		dprintf_info(mciwave,"Linux 'widOpen' // CALLBACK_WINDOW!\n");
+		TRACE(mciwave,"CALLBACK_WINDOW!\n");
 		break;
 	case DCB_TASK:
-		dprintf_info(mciwave,"Linux 'widOpen' // CALLBACK_TASK!\n");
+		TRACE(mciwave,"CALLBACK_TASK!\n");
 		break;
 	case DCB_FUNCTION:
-		dprintf_info(mciwave,"Linux 'widOpen' // CALLBACK_FUNCTION!\n");
+		TRACE(mciwave,"CALLBACK_FUNCTION!\n");
 		break;
 	}
 	if (WInDev[wDevID].lpQueueHdr) {
@@ -1384,7 +1367,7 @@
 	memcpy(&WInDev[wDevID].waveDesc, lpDesc, sizeof(WAVEOPENDESC));
         lpFormat = (LPWAVEFORMAT) lpDesc->lpFormat; 
 	if (lpFormat->wFormatTag != WAVE_FORMAT_PCM) {
-		dprintf_warn(mciwave, "Linux 'widOpen' // Bad format %04X !\n",
+		WARN(mciwave, "Bad format %04X !\n",
 					lpFormat->wFormatTag);
 		return WAVERR_BADFORMAT;
 	}
@@ -1404,16 +1387,16 @@
 	IOCTL(audio, SNDCTL_DSP_SPEED, smplrate);
 	IOCTL(audio, SNDCTL_DSP_SAMPLESIZE, samplesize);
 	IOCTL(audio, SNDCTL_DSP_STEREO, dsp_stereo);
-	dprintf_info(mciwave,"Linux 'widOpen' // wBitsPerSample=%u !\n",
+	TRACE(mciwave,"wBitsPerSample=%u !\n",
 				WInDev[wDevID].Format.wBitsPerSample);
-	dprintf_info(mciwave,"Linux 'widOpen' // nSamplesPerSec=%lu !\n",
+	TRACE(mciwave,"nSamplesPerSec=%lu !\n",
 				WInDev[wDevID].Format.wf.nSamplesPerSec);
-	dprintf_info(mciwave,"Linux 'widOpen' // nChannels=%u !\n",
+	TRACE(mciwave,"nChannels=%u !\n",
 				WInDev[wDevID].Format.wf.nChannels);
-	dprintf_info(mciwave,"Linux 'widOpen' // nAvgBytesPerSec=%lu\n",
+	TRACE(mciwave,"nAvgBytesPerSec=%lu\n",
 			WInDev[wDevID].Format.wf.nAvgBytesPerSec); 
 	if (WAVE_NotifyClient(wDevID, WIM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) {
-		dprintf_warn(mciwave,"Linux 'widOpen' // can't notify client !\n");
+		WARN(mciwave,"can't notify client !\n");
 		return MMSYSERR_INVALPARAM;
 	}
 	return MMSYSERR_NOERROR;
@@ -1424,21 +1407,21 @@
  */
 static DWORD widClose(WORD wDevID)
 {
-	dprintf_info(mciwave,"widClose(%u);\n", wDevID);
+	TRACE(mciwave,"(%u);\n", wDevID);
 	if (wDevID > MAX_WAVINDRV) return MMSYSERR_INVALPARAM;
 	if (WInDev[wDevID].unixdev == 0) {
-		dprintf_warn(mciwave,"Linux 'widClose' // can't close !\n");
+		WARN(mciwave,"can't close !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	if (WInDev[wDevID].lpQueueHdr != NULL) {
-	        dprintf_warn(mciwave, "linux 'widclose' // still buffers open !\n");
+	        WARN(mciwave, "still buffers open !\n");
 		return WAVERR_STILLPLAYING;
 	}
 	close(WInDev[wDevID].unixdev);
 	WInDev[wDevID].unixdev = 0;
 	WInDev[wDevID].bufsize = 0;
 	if (WAVE_NotifyClient(wDevID, WIM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) {
-		dprintf_warn(mciwave,"Linux 'widClose' // can't notify client !\n");
+		WARN(mciwave,"can't notify client !\n");
 		return MMSYSERR_INVALPARAM;
 	}
 	return MMSYSERR_NOERROR;
@@ -1452,18 +1435,17 @@
 	int		count	= 1;
 	LPWAVEHDR 	lpWIHdr;
 
-	dprintf_info(mciwave,
-		"widAddBuffer(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize);
+	TRACE(mciwave, "(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize);
 	if (WInDev[wDevID].unixdev == 0) {
-		dprintf_warn(mciwave,"Linux 'widAddBuffer' // can't do it !\n");
+		WARN(mciwave,"can't do it !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	if (!(lpWaveHdr->dwFlags & WHDR_PREPARED)) {
-		dprintf_info(mciwave,	"Linux 'widAddBuffer' // never been prepared !\n");
+		TRACE(mciwave, "never been prepared !\n");
 		return WAVERR_UNPREPARED;
 	}
 	if (lpWaveHdr->dwFlags & WHDR_INQUEUE) {
-		dprintf_info(mciwave,	"Linux 'widAddBuffer' // header already in use !\n");
+		TRACE(mciwave,	"header already in use !\n");
 		return WAVERR_STILLPLAYING;
 	}
 	lpWaveHdr->dwFlags |= WHDR_PREPARED;
@@ -1482,8 +1464,7 @@
 		lpWaveHdr->lpNext = NULL;
 		count++;
 	}
-	dprintf_info(mciwave,
-		"widAddBuffer // buffer added ! (now %u in queue)\n", count);
+	TRACE(mciwave, "buffer added ! (now %u in queue)\n", count);
 	return MMSYSERR_NOERROR;
 }
 
@@ -1492,10 +1473,9 @@
  */
 static DWORD widPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
 {
-	dprintf_info(mciwave,
-		"widPrepare(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize);
+	TRACE(mciwave, "(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize);
 	if (WInDev[wDevID].unixdev == 0) {
-		dprintf_warn(mciwave,"Linux 'widPrepare' // can't prepare !\n");
+		WARN(mciwave,"can't prepare !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	if (lpWaveHdr->dwFlags & WHDR_INQUEUE)
@@ -1504,7 +1484,7 @@
 	lpWaveHdr->dwFlags &= ~WHDR_INQUEUE;
 	lpWaveHdr->dwFlags &= ~WHDR_DONE;
 	lpWaveHdr->dwBytesRecorded = 0;
-	dprintf_info(mciwave,"Linux 'widPrepare' // header prepared !\n");
+	TRACE(mciwave,"header prepared !\n");
 	return MMSYSERR_NOERROR;
 }
 
@@ -1513,17 +1493,16 @@
  */
 static DWORD widUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
 {
-	dprintf_info(mciwave,
-		"widUnprepare(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize);
+	TRACE(mciwave, "(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize);
 	if (WInDev[wDevID].unixdev == 0) {
-		dprintf_warn(mciwave,"Linux 'widUnprepare' // can't unprepare !\n");
+		WARN(mciwave,"can't unprepare !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	lpWaveHdr->dwFlags &= ~WHDR_PREPARED;
 	lpWaveHdr->dwFlags &= ~WHDR_INQUEUE;
 	lpWaveHdr->dwFlags |= WHDR_DONE;
 
-	dprintf_info(mciwave, "Linux 'widUnprepare' // all headers unprepared !\n");
+	TRACE(mciwave, "all headers unprepared !\n");
 	return MMSYSERR_NOERROR;
 }
 
@@ -1537,23 +1516,22 @@
 	LPWAVEHDR 	lpWIHdr;
 	LPWAVEHDR	*lpWaveHdr;
 
-	dprintf_info(mciwave,"widStart(%u);\n", wDevID);
+	TRACE(mciwave,"(%u);\n", wDevID);
 	if (WInDev[wDevID].unixdev == 0) {
-		dprintf_warn(mciwave,	"Linux 'widStart' // can't start recording !\n");
+		WARN(mciwave, "can't start recording !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 
 	lpWaveHdr = &(WInDev[wDevID].lpQueueHdr);
-	dprintf_info(mciwave,"Linux 'widstart'// lpWaveHdr = %08lx\n",(DWORD)lpWaveHdr);
+	TRACE(mciwave,"lpWaveHdr = %08lx\n",(DWORD)lpWaveHdr);
 	if (!*lpWaveHdr || !(*lpWaveHdr)->lpData) {
-		dprintf_info(mciwave,"Linux 'widStart' // never been prepared !\n");
+		TRACE(mciwave,"never been prepared !\n");
 		return WAVERR_UNPREPARED;
 	}
 
 	while(*lpWaveHdr != NULL) {
 	        lpWIHdr = *lpWaveHdr;
-		dprintf_info(mciwave,
-			"widStart // recording buf#%u=%p size=%lu \n",
+		TRACE(mciwave, "recording buf#%u=%p size=%lu \n",
 			count, lpWIHdr->lpData, lpWIHdr->dwBufferLength);
 		fflush(stddeb);
 		bytesRead = read (WInDev[wDevID].unixdev, 
@@ -1569,14 +1547,14 @@
 
 		/* FIXME: should pass segmented pointer here, do we need that?*/
 		if (WAVE_NotifyClient(wDevID, WIM_DATA, (DWORD)lpWaveHdr, lpWIHdr->dwBytesRecorded) != MMSYSERR_NOERROR) {
-			dprintf_warn(mciwave,	"Linux 'widStart' // can't notify client !\n");
+			WARN(mciwave, "can't notify client !\n");
 			return MMSYSERR_INVALPARAM;
 		}
 		/* removes the current block from the queue */
 		*lpWaveHdr = lpWIHdr->lpNext;
 		count++;
 	}
-	dprintf_info(mciwave,"widStart // end of recording !\n");
+	TRACE(mciwave,"end of recording !\n");
 	fflush(stddeb);
 	return MMSYSERR_NOERROR;
 }
@@ -1586,9 +1564,9 @@
  */
 static DWORD widStop(WORD wDevID)
 {
-	dprintf_info(mciwave,"widStop(%u);\n", wDevID);
+	TRACE(mciwave,"(%u);\n", wDevID);
 	if (WInDev[wDevID].unixdev == 0) {
-		dprintf_warn(mciwave,"Linux 'widStop' // can't stop !\n");
+		WARN(mciwave,"can't stop !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	return MMSYSERR_NOERROR;
@@ -1599,9 +1577,9 @@
  */
 static DWORD widReset(WORD wDevID)
 {
-	dprintf_info(mciwave,"widReset(%u);\n", wDevID);
+	TRACE(mciwave,"(%u);\n", wDevID);
 	if (WInDev[wDevID].unixdev == 0) {
-		dprintf_warn(mciwave,"Linux 'widReset' // can't reset !\n");
+		WARN(mciwave,"can't reset !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	return MMSYSERR_NOERROR;
@@ -1614,36 +1592,32 @@
 {
 	int		time;
     
-	dprintf_info(mciwave,
-		"widGetPosition(%u, %p, %lu);\n", wDevID, lpTime, uSize);
+	TRACE(mciwave, "(%u, %p, %lu);\n", wDevID, lpTime, uSize);
 	if (WInDev[wDevID].unixdev == 0) {
-		dprintf_warn(mciwave,"Linux 'widGetPosition' // can't get pos !\n");
+		WARN(mciwave,"can't get pos !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	if (lpTime == NULL)	return MMSYSERR_INVALPARAM;
-	dprintf_info(mciwave,"widGetPosition // wType=%04X !\n", 
+	TRACE(mciwave,"wType=%04X !\n", 
 			lpTime->wType);
-	dprintf_info(mciwave,"widGetPosition // wBitsPerSample=%u\n",
+	TRACE(mciwave,"wBitsPerSample=%u\n",
 			WInDev[wDevID].Format.wBitsPerSample); 
-	dprintf_info(mciwave,"widGetPosition // nSamplesPerSec=%lu\n",
+	TRACE(mciwave,"nSamplesPerSec=%lu\n",
 			WInDev[wDevID].Format.wf.nSamplesPerSec); 
-	dprintf_info(mciwave,"widGetPosition // nChannels=%u\n",
+	TRACE(mciwave,"nChannels=%u\n",
 			WInDev[wDevID].Format.wf.nChannels); 
-	dprintf_info(mciwave,"widGetPosition // nAvgBytesPerSec=%lu\n",
+	TRACE(mciwave,"nAvgBytesPerSec=%lu\n",
 			WInDev[wDevID].Format.wf.nAvgBytesPerSec); 
 	fflush(stddeb);
 	switch(lpTime->wType) {
 	case TIME_BYTES:
 		lpTime->u.cb = WInDev[wDevID].dwTotalRecorded;
-		dprintf_info(mciwave,
-		    "widGetPosition // TIME_BYTES=%lu\n", lpTime->u.cb);
+		TRACE(mciwave,"TIME_BYTES=%lu\n", lpTime->u.cb);
 		break;
 	case TIME_SAMPLES:
 		lpTime->u.sample = WInDev[wDevID].dwTotalRecorded * 8 /
 				  WInDev[wDevID].Format.wBitsPerSample;
-		dprintf_info(mciwave,
-				"widGetPosition // TIME_SAMPLES=%lu\n", 
-				lpTime->u.sample);
+		TRACE(mciwave, "TIME_SAMPLES=%lu\n", lpTime->u.sample);
 		break;
 	case TIME_SMPTE:
 		time = WInDev[wDevID].dwTotalRecorded /
@@ -1656,18 +1630,17 @@
 		time -= lpTime->u.smpte.sec * 30;
 		lpTime->u.smpte.frame = time;
 		lpTime->u.smpte.fps = 30;
-dprintf_info(mciwave,"widGetPosition // TIME_SMPTE=%02u:%02u:%02u:%02u\n",
-				lpTime->u.smpte.hour, lpTime->u.smpte.min,
-				lpTime->u.smpte.sec, lpTime->u.smpte.frame);
+		TRACE(mciwave,"TIME_SMPTE=%02u:%02u:%02u:%02u\n",
+			     lpTime->u.smpte.hour, lpTime->u.smpte.min,
+			     lpTime->u.smpte.sec, lpTime->u.smpte.frame);
 		break;
 	default:
-		dprintf_fixme(mciwave, "widGetPosition() format not supported ! use TIME_MS !\n");
+		FIXME(mciwave, "format not supported ! use TIME_MS !\n");
 		lpTime->wType = TIME_MS;
 	case TIME_MS:
 		lpTime->u.ms = WInDev[wDevID].dwTotalRecorded /
 				(WInDev[wDevID].Format.wf.nAvgBytesPerSec / 1000);
-		dprintf_info(mciwave,
-		      "widGetPosition // TIME_MS=%lu\n", lpTime->u.ms);
+		TRACE(mciwave, "TIME_MS=%lu\n", lpTime->u.ms);
 		break;
 	}
 	return MMSYSERR_NOERROR;
@@ -1679,7 +1652,8 @@
 DWORD widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, 
 					DWORD dwParam1, DWORD dwParam2)
 {
-	dprintf_info(mciwave,"widMessage(%u, %04X, %08lX, %08lX, %08lX);\n",
+  int audio;
+	TRACE(mciwave,"widMessage(%u, %04X, %08lX, %08lX, %08lX);\n",
 			wDevID, wMsg, dwUser, dwParam1, dwParam2);
 	switch(wMsg) {
 	case WIDM_OPEN:
@@ -1695,6 +1669,14 @@
 	case WIDM_GETDEVCAPS:
 		return widGetDevCaps(wDevID, (LPWAVEINCAPS16)dwParam1,dwParam2);
 	case WIDM_GETNUMDEVS:
+	  /* FIXME: For now, only one sound device (SOUND_DEV) is allowed */
+	  audio = open (SOUND_DEV, O_RDONLY, 0);
+	  if (audio == -1)
+	    if (errno == EBUSY)
+	      return 1;
+	    else
+	      return 0;
+	  close (audio);
 		return 1;
 	case WIDM_GETPOS:
 		return widGetPosition(wDevID, (LPMMTIME16)dwParam1, dwParam2);
@@ -1707,7 +1689,7 @@
 	case WIDM_STOP:
 		return widStop(wDevID);
 	default:
-		dprintf_warn(mciwave,"widMessage // unknown message !\n");
+		WARN(mciwave,"unknown message !\n");
 	}
 	return MMSYSERR_NOTSUPPORTED;
 }
@@ -1719,7 +1701,7 @@
 LONG WAVE_DriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg, 
 		     DWORD dwParam1, DWORD dwParam2)
 {
-	dprintf_info(mciwave,"WAVE_DriverProc(%08lX, %04X, %04X, %08lX, %08lX)\n", 
+	TRACE(mciwave,"(%08lX, %04X, %04X, %08lX, %08lX)\n", 
 		dwDevID, hDriv, wMsg, dwParam1, dwParam2);
 	switch(wMsg) {
 	case DRV_LOAD:
diff --git a/multimedia/dsound.c b/multimedia/dsound.c
index a719048..831dabf 100644
--- a/multimedia/dsound.c
+++ b/multimedia/dsound.c
@@ -46,7 +46,11 @@
 
 #ifdef HAVE_OSS
 #include <sys/ioctl.h>
+#ifdef HAVE_MACHINE_SOUNDCARD_H
+#include <machine/soundcard.h>
+#else /* HAVE_MACHINE_SOUNDCARD_H */
 #include <sys/soundcard.h>
+#endif /* HAVE_MACHINE_SOUNDCARD_H */
 
 static int audiofd = -1;
 static LPDIRECTSOUND	dsound = NULL;
@@ -127,7 +131,7 @@
 ) {
 	int	i;
 
-	if (debugging_info(dsound)) {
+	if (TRACE_ON(dsound)) {
 	    fprintf(stderr,"IDirectSoundNotify(%p)->SetNotificationPositions(0x%08lx,%p)\n",this,howmuch,notify);
 	    for (i=0;i<howmuch;i++)
 		    fprintf(stderr,"	notify at %ld to 0x%08lx\n",notify[i].dwOffset,(DWORD)notify[i].hEventNotify);
@@ -157,9 +161,9 @@
 ) {
 
 	memcpy(&(this->wfx),wfex,sizeof(this->wfx));
-	dprintf_fixme(dsound,"IDirectSoundBuffer(%p)->SetFormat(%p)\n",
+	TRACE(dsound,"(%p)->SetFormat(%p)\n",
 		       this,wfex);
-	dprintf_info(dsound,"	[formattag=0x%04x,chans=%d,samplerate=%ld"
+	TRACE(dsound,"	[formattag=0x%04x,chans=%d,samplerate=%ld"
 		   "bytespersec=%ld,blockalign=%d,bitspersamp=%d,cbSize=%d]\n",
 		   wfex->wFormatTag, wfex->nChannels, wfex->nSamplesPerSec,
 		   wfex->nAvgBytesPerSec, wfex->nBlockAlign, 
@@ -171,7 +175,7 @@
 static HRESULT WINAPI IDirectSoundBuffer_SetVolume(
 	LPDIRECTSOUNDBUFFER this,LONG vol
 ) {
-	fprintf(stderr,"IDirectSoundBuffer(%p)->SetVolume(%ld)\n",this,vol);
+	fprintf(stderr,"(%p)->SetVolume(%ld)\n",this,vol);
 	this->volume = vol;
 	this->volfac = ((double)vol+10000.0)/10000.0;
 	return 0;
@@ -180,7 +184,7 @@
 static HRESULT WINAPI IDirectSoundBuffer_GetVolume(
 	LPDIRECTSOUNDBUFFER this,LPLONG vol
 ) {
-	dprintf_fixme(dsound,"IDirectSoundBuffer(%p)->GetVolume(%p)\n",this,vol);
+	TRACE(dsound,"(%p)->GetVolume(%p)\n",this,vol);
 	*vol = this->volume;
 	return 0;
 }
@@ -188,7 +192,7 @@
 static HRESULT WINAPI IDirectSoundBuffer_SetFrequency(
 	LPDIRECTSOUNDBUFFER this,DWORD freq
 ) {
-	dprintf_fixme(dsound,"IDirectSoundBuffer(%p)->SetFrequency(%ld)\n",this,freq);
+	TRACE(dsound,"(%p)->SetFrequency(%ld)\n",this,freq);
 	this->wfx.nSamplesPerSec = freq;
 	this->wfx.nAvgBytesPerSec = freq*this->wfx.nChannels*(this->wfx.wBitsPerSample/8);
 	return 0;
@@ -197,7 +201,7 @@
 static HRESULT WINAPI IDirectSoundBuffer_Play(
 	LPDIRECTSOUNDBUFFER this,DWORD reserved1,DWORD reserved2,DWORD flags
 ) {
-	dprintf_fixme(dsound,"IDirectSoundBuffer(%p)->Play(%08lx,%08lx,%08lx)\n",
+	TRACE(dsound,"(%p)->Play(%08lx,%08lx,%08lx)\n",
 		this,reserved1,reserved2,flags
 	);
 	this->playpos = 0;
@@ -207,7 +211,7 @@
 }
 
 static HRESULT WINAPI IDirectSoundBuffer_Stop(LPDIRECTSOUNDBUFFER this) {
-	dprintf_info(dsound,"IDirectSoundBuffer(%p)->Stop()\n",this);
+	TRACE(dsound,"(%p)->Stop()\n",this);
 	this->playing = 0;
 	this->writepos = 0; /* hmm */
 	return 0;
@@ -241,7 +245,7 @@
 static HRESULT WINAPI IDirectSoundBuffer_GetCurrentPosition(
 	LPDIRECTSOUNDBUFFER this,LPDWORD playpos,LPDWORD writepos
 ) {
-	dprintf_fixme(dsound,"IDirectSoundBuffer(%p)->GetCurrentPosition(%p,%p)\n",this,playpos,writepos);
+	TRACE(dsound,"(%p)->GetCurrentPosition(%p,%p)\n",this,playpos,writepos);
 	if (playpos) *playpos = this->playpos;
 	if (writepos) *writepos = this->writepos;
 	return 0;
@@ -250,7 +254,7 @@
 static HRESULT WINAPI IDirectSoundBuffer_GetStatus(
 	LPDIRECTSOUNDBUFFER this,LPDWORD status
 ) {
-	dprintf_info(dsound,"IDirectSoundBuffer(%p)->GetStatus(%p)\n",this,status);
+	TRACE(dsound,"(%p)->GetStatus(%p)\n",this,status);
 	*status = 0;
 	if (this->playing)
 		*status |= DSBSTATUS_PLAYING;
@@ -262,7 +266,7 @@
 static HRESULT WINAPI IDirectSoundBuffer_GetFormat(
 	LPDIRECTSOUNDBUFFER this,LPWAVEFORMATEX lpwf,DWORD wfsize,LPDWORD wfwritten
 ) {
-	dprintf_info(dsound,"IDirectSoundBuffer(%p)->GetFormat(%p,%ld,%p)\n",this,lpwf,wfsize,wfwritten);
+	TRACE(dsound,"(%p)->GetFormat(%p,%ld,%p)\n",this,lpwf,wfsize,wfwritten);
 	if (wfsize>sizeof(this->wfx)) wfsize = sizeof(this->wfx);
 	memcpy(lpwf,&(this->wfx),wfsize);
 	if (wfwritten) *wfwritten = wfsize;
@@ -273,7 +277,7 @@
 	LPDIRECTSOUNDBUFFER this,DWORD writecursor,DWORD writebytes,LPVOID lplpaudioptr1,LPDWORD audiobytes1,LPVOID lplpaudioptr2,LPDWORD audiobytes2,DWORD flags
 ) {
 
-	dprintf_info(dsound,"IDirectSoundBuffer(%p)->Lock(%ld,%ld,%p,%p,%p,%p,0x%08lx)\n",
+	TRACE(dsound,"(%p)->Lock(%ld,%ld,%p,%p,%p,%p,0x%08lx)\n",
 		this,
 		writecursor,
 		writebytes,
@@ -294,7 +298,7 @@
 			*(LPBYTE*)lplpaudioptr2 = NULL;
 		if (audiobytes2)
 			*audiobytes2 = 0;
-		dprintf_info(dsound,"->%ld.0\n",writebytes);
+		TRACE(dsound,"->%ld.0\n",writebytes);
 	} else {
 		*(LPBYTE*)lplpaudioptr1 = this->buffer+writecursor;
 		*audiobytes1 = this->buflen-writecursor;
@@ -302,7 +306,7 @@
 			*(LPBYTE*)lplpaudioptr2 = this->buffer;
 		if (audiobytes2)
 			*audiobytes2 = writebytes-(this->buflen-writecursor);
-		dprintf_info(dsound,"->%ld.%ld\n",*audiobytes1,audiobytes2?*audiobytes2:0);
+		TRACE(dsound,"->%ld.%ld\n",*audiobytes1,audiobytes2?*audiobytes2:0);
 	}
 	this->writepos=(writecursor+writebytes)%this->buflen;
 	return 0;
@@ -311,7 +315,7 @@
 static HRESULT WINAPI IDirectSoundBuffer_SetCurrentPosition(
 	LPDIRECTSOUNDBUFFER this,DWORD newpos
 ) {
-	dprintf_info(dsound,"IDirectSoundBuffer(%p)->SetCurrentPosition(%ld)\n",this,newpos);
+	TRACE(dsound,"(%p)->SetCurrentPosition(%ld)\n",this,newpos);
 	this->playpos = newpos;
 	return 0;
 }
@@ -319,7 +323,7 @@
 static HRESULT WINAPI IDirectSoundBuffer_SetPan(
 	LPDIRECTSOUNDBUFFER this,LONG newpan
 ) {
-	dprintf_fixme(dsound,"IDirectSoundBuffer(%p)->SetPan(%ld)\n",this,newpan);
+	TRACE(dsound,"(%p)->SetPan(%ld)\n",this,newpan);
 	this->pan = newpan;
 	return 0;
 }
@@ -327,7 +331,7 @@
 static HRESULT WINAPI IDirectSoundBuffer_GetPan(
 	LPDIRECTSOUNDBUFFER this,LPLONG pan
 ) {
-	dprintf_fixme(dsound,"IDirectSoundBuffer(%p)->GetPan(%p)\n",this,pan);
+	TRACE(dsound,"(%p)->GetPan(%p)\n",this,pan);
 	*pan = this->pan;
 	return 0;
 }
@@ -335,7 +339,7 @@
 static HRESULT WINAPI IDirectSoundBuffer_Unlock(
 	LPDIRECTSOUNDBUFFER this,LPVOID p1,DWORD x1,LPVOID p2,DWORD x2
 ) {
-	dprintf_info(dsound,"IDirectSoundBuffer(%p)->Unlock(%p,%ld,%p,%ld)\n",
+	TRACE(dsound,"(%p)->Unlock(%p,%ld,%p,%ld)\n",
 		this,p1,x1,p2,x2
 	);
 	return 0;
@@ -344,7 +348,7 @@
 static HRESULT WINAPI IDirectSoundBuffer_GetFrequency(
 	LPDIRECTSOUNDBUFFER this,LPDWORD freq
 ) {
-	dprintf_info(dsound,"IDirectSoundBuffer(%p)->GetFrequency(%p)\n",
+	TRACE(dsound,"(%p)->GetFrequency(%p)\n",
 		this,freq
 	);
 	*freq = this->wfx.nSamplesPerSec;
@@ -354,7 +358,7 @@
 static HRESULT WINAPI IDirectSoundBuffer_Initialize(
 	LPDIRECTSOUNDBUFFER this,LPDIRECTSOUND dsound,LPDSBUFFERDESC dbsd
 ) {
-	fprintf(stderr,"IDirectSoundBuffer(%p)->Initialize(%p,%p)\n",this,dsound,dbsd);
+	fprintf(stderr,"(%p)->Initialize(%p,%p)\n",this,dsound,dbsd);
 	return DSERR_ALREADYINITIALIZED;
 }
 
@@ -386,7 +390,7 @@
 		return 0;
 	}
 	WINE_StringFromCLSID(riid,xbuf);
-	fprintf(stderr,"IDirectSoundBuffer(%p)->QueryInterface(%s,%p)\n",this,xbuf,ppobj);
+	fprintf(stderr,"(%p)->QueryInterface(%s,%p)\n",this,xbuf,ppobj);
 	return E_FAIL;
 }
 
@@ -420,7 +424,7 @@
 static HRESULT WINAPI IDirectSound_SetCooperativeLevel(
 	LPDIRECTSOUND this,HWND32 hwnd,DWORD level
 ) {
-	dprintf_info(dsound,"IDirectSound(%p)->SetCooperativeLevel(%08lx,%ld)\n",
+	TRACE(dsound,"(%p)->SetCooperativeLevel(%08lx,%ld)\n",
 		this,(DWORD)hwnd,level
 	);
 	return 0;
@@ -430,7 +434,7 @@
 static HRESULT WINAPI IDirectSound_CreateSoundBuffer(
 	LPDIRECTSOUND this,LPDSBUFFERDESC dsbd,LPLPDIRECTSOUNDBUFFER ppdsb,LPUNKNOWN lpunk
 ) {
-	if (debugging_info(dsound)) {
+	if (TRACE_ON(dsound)) {
 		fprintf(stderr,"IDirectSound(%p)->CreateSoundBuffer(%p,%p,%p)\n",this,dsbd,ppdsb,lpunk);
 		fprintf(stderr,"[size=%ld,",dsbd->dwSize);
 		fprintf(stderr,"flags = 0x%08lx,",dsbd->dwFlags);
@@ -463,7 +467,7 @@
 static HRESULT WINAPI IDirectSound_DuplicateSoundBuffer(
 	LPDIRECTSOUND this,LPDIRECTSOUNDBUFFER pdsb,LPLPDIRECTSOUNDBUFFER ppdsb
 ) {
-	dprintf_fixme(dsound,"IDirectSound(%p)->DuplicateSoundBuffer(%p,%p)\n",this,pdsb,ppdsb);
+	TRACE(dsound,"IDirectSound(%p)->DuplicateSoundBuffer(%p,%p)\n",this,pdsb,ppdsb);
 
 	*ppdsb = (LPDIRECTSOUNDBUFFER)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectSoundBuffer));
 	(*ppdsb)->ref =1;
@@ -485,8 +489,8 @@
 
 
 static HRESULT WINAPI IDirectSound_GetCaps(LPDIRECTSOUND this,LPDSCAPS caps) {
-	dprintf_fixme(dsound,"IDirectSound(%p)->GetCaps(%p)\n",this,caps);
-	dprintf_fixme(dsound,"	flags = 0x%08lx\n",caps->dwFlags);
+	TRACE(dsound,"IDirectSound(%p)->GetCaps(%p)\n",this,caps);
+	TRACE(dsound,"	flags = 0x%08lx\n",caps->dwFlags);
 
 	caps->dwSize = sizeof(*caps);
 	caps->dwFlags = DSCAPS_PRIMARYSTEREO|DSCAPS_PRIMARY16BIT|DSCAPS_EMULDRIVER|DSCAPS_SECONDARYSTEREO|DSCAPS_SECONDARY16BIT;
@@ -748,7 +752,7 @@
 						return;
 					}
 					/* FIXME: pan,volume */
-					playbuf[j]+=xbuf[dsb->playpos>>1]*volfac;
+					playbuf[j]+=xbuf[dsb->playpos>>1]/**volfac*/;
 					CHECK_EVENT
 				}
 			}
@@ -759,10 +763,8 @@
 static DWORD
 DSOUND_thread(LPVOID arg) {
 	int	res,i,curleft,playing,haveprimary = 0;
-	struct audio_buf_info	abi;
 
 	fprintf(stderr,"dsound is at pid %d\n",getpid());
-	ioctl(audiofd,SNDCTL_DSP_GETOSPACE,&abi);
 	while (1) {
 		if (!dsound) {
 			fprintf(stderr,"DSOUND thread giving up.\n");
@@ -858,9 +860,11 @@
 	xx=0x0002000c;
 	if (-1==ioctl(audiofd,SNDCTL_DSP_SETFRAGMENT,&xx))
 		perror("ioctl SETFRAGMENT");
+/*
 	fprintf(stderr,"SETFRAGMENT. count is now %d, fragsize is %d\n",
 		(xx>>16)+1,xx&0xffff
 	);
+ */
 
 	*ppDS = (LPDIRECTSOUND)HeapAlloc(GetProcessHeap(),0,sizeof(IDirectSound));
 	(*ppDS)->ref		= 1;
diff --git a/multimedia/joystick.c b/multimedia/joystick.c
index ae1c568..6a8d2e6 100644
--- a/multimedia/joystick.c
+++ b/multimedia/joystick.c
@@ -94,7 +94,9 @@
 		} else
 			return;
         if (joyCaptured == FALSE) return;
-	dprintf_info(mmsys, "JoySendMessages()\n");
+
+	TRACE(mmsys, " --\n");
+
         for (joy=0; joy < MAXJOYDRIVERS; joy++) {
 		if (joyOpenDriver(joy) == FALSE) continue;
                 dev_stat = read(joy_dev[joy], &js, sizeof(js));
@@ -142,7 +144,7 @@
 		joyCloseDriver(joy);
 		joy_cnt++;
     }
-    dprintf_info(mmsys, "returning %d\n", joy_cnt);
+    TRACE(mmsys, "returning %d\n", joy_cnt);
     if (!joy_cnt) fprintf(stderr, "No joystick found - "
 			  "perhaps get joystick-0.8.0.tar.gz and load"
 			  "it as module or use Linux >= 2.1.45 to be "
@@ -226,7 +228,7 @@
  */
 MMRESULT16 WINAPI joyGetDevCaps16(UINT16 wID, LPJOYCAPS16 lpCaps, UINT16 wSize)
 {
-    dprintf_info(mmsys, "JoyGetDevCaps(%04X, %p, %d);\n",
+    TRACE(mmsys, "(%04X, %p, %d);\n",
             wID, lpCaps, wSize);
     if (joyOpenDriver(wID) == TRUE) {
         lpCaps->wMid = MM_MICROSOFT;
@@ -294,7 +296,7 @@
 {
         struct js_status js;
 
-        dprintf_info(mmsys, "JoyGetPos(%04X, %p)\n", wID, lpInfo);
+        TRACE(mmsys, "(%04X, %p)\n", wID, lpInfo);
         if (joyOpenDriver(wID) == FALSE) return MMSYSERR_NODRIVER;
 	dev_stat = read(joy_dev[wID], &js, sizeof(js));
 	if (dev_stat != sizeof(js)) {
@@ -308,7 +310,7 @@
 	lpInfo->wYpos = js.y;
 	lpInfo->wZpos = 0; /* FIXME: Don't know what to do with this value as joystick driver doesn't provide a Z value */
 	lpInfo->wButtons = js.buttons;
-	dprintf_info(mmsys, "JoyGetPos: x: %d, y: %d, buttons: %d\n", js.x, js.y, js.buttons);
+	TRACE(mmsys, "x: %d, y: %d, buttons: %d\n", js.x, js.y, js.buttons);
 	return JOYERR_NOERROR;
 }
 
@@ -329,7 +331,7 @@
  */
 MMRESULT16 WINAPI joyGetThreshold16(UINT16 wID, LPUINT16 lpThreshold)
 {
-    dprintf_info(mmsys, "JoyGetThreshold(%04X, %p);\n", wID, lpThreshold);
+    TRACE(mmsys, "(%04X, %p);\n", wID, lpThreshold);
     if (wID >= MAXJOYDRIVERS) return JOYERR_PARMS;
     *lpThreshold = joy_threshold[wID];
     return JOYERR_NOERROR;
@@ -348,7 +350,7 @@
  */
 MMRESULT16 WINAPI joyReleaseCapture16(UINT16 wID)
 {
-    dprintf_info(mmsys, "JoyReleaseCapture(%04X);\n", wID);
+    TRACE(mmsys, "(%04X);\n", wID);
     joyCaptured = FALSE;
     joyCloseDriver(wID);
     joy_dev[wID] = -1;
@@ -370,7 +372,7 @@
 MMRESULT16 WINAPI joySetCapture16(HWND16 hWnd,UINT16 wID,UINT16 wPeriod,BOOL16 bChanged)
 {
 
-    dprintf_info(mmsys, "JoySetCapture(%04X, %04X, %d, %d);\n",
+    TRACE(mmsys, "(%04X, %04X, %d, %d);\n",
 	    hWnd, wID, wPeriod, bChanged);
 
     if (!CaptureWnd[wID]) {
@@ -395,7 +397,7 @@
  */
 MMRESULT16 WINAPI joySetThreshold16(UINT16 wID, UINT16 wThreshold)
 {
-    dprintf_info(mmsys, "JoySetThreshold(%04X, %d);\n", wID, wThreshold);
+    TRACE(mmsys, "(%04X, %d);\n", wID, wThreshold);
 
     if (wID > 3) return JOYERR_PARMS;
     joy_threshold[wID] = wThreshold;
diff --git a/multimedia/mcianim.c b/multimedia/mcianim.c
index aa545a5..80d8970 100644
--- a/multimedia/mcianim.c
+++ b/multimedia/mcianim.c
@@ -54,7 +54,7 @@
 	LPSTR		lpstrElementName;
 	char		str[128];
 
-	dprintf_info(mcianim,"ANIM_mciOpen(%04X, %08lX, %p);\n", 
+	TRACE(mcianim,"(%04X, %08lX, %p);\n", 
 					wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (AnimDev[wDevID].nUseCount > 0) {
@@ -70,12 +70,12 @@
 		AnimDev[wDevID].nUseCount = 1;
 		AnimDev[wDevID].fShareable = dwFlags & MCI_OPEN_SHAREABLE;
 		}
-	dprintf_info(mcianim,"ANIM_mciOpen // wDevID=%04X\n", wDevID);
+	TRACE(mcianim,"wDevID=%04X\n", wDevID);
 	lpParms->wDeviceID = wDevID;
-	dprintf_info(mcianim,"ANIM_mciOpen // lpParms->wDevID=%04X\n", lpParms->wDeviceID);
+	TRACE(mcianim,"lpParms->wDevID=%04X\n", lpParms->wDeviceID);
     if (dwFlags & MCI_OPEN_ELEMENT) {
 		lpstrElementName = (LPSTR)PTR_SEG_TO_LIN(lpParms->lpstrElementName);
-		dprintf_info(mcianim,"ANIM_mciOpen // MCI_OPEN_ELEMENT '%s' !\n",
+		TRACE(mcianim,"MCI_OPEN_ELEMENT '%s' !\n",
 						lpstrElementName);
 		if (strlen(lpstrElementName) > 0) {
 			strcpy(str, lpstrElementName);
@@ -95,8 +95,7 @@
    Moved to mmsystem.c mciOpen routine 
 
 	if (dwFlags & MCI_NOTIFY) {
-		dprintf_info(mcianim,
-			"ANIM_mciOpen // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+		TRACE(mcianim, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 			lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
@@ -114,7 +113,7 @@
 static DWORD ANIM_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(mcianim,"ANIM_mciClose(%u, %08lX, %p);\n", 
+	TRACE(mcianim,"(%u, %08lX, %p);\n", 
 				wDevID, dwParam, lpParms);
 	if (AnimDev[wDevID].lpdwTrackLen != NULL) free(AnimDev[wDevID].lpdwTrackLen);
 	if (AnimDev[wDevID].lpdwTrackPos != NULL) free(AnimDev[wDevID].lpdwTrackPos);
@@ -129,12 +128,11 @@
 						LPMCI_GETDEVCAPS_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(mcianim,"ANIM_mciGetDevCaps(%u, %08lX, %p);\n", 
+	TRACE(mcianim,"(%u, %08lX, %p);\n", 
 				wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (dwFlags & MCI_GETDEVCAPS_ITEM) {
-        	dprintf_info(mcianim,
-		"ANIM_mciGetDevCaps // MCI_GETDEVCAPS_ITEM dwItem=%08lX;\n",
+        	TRACE(mcianim, "MCI_GETDEVCAPS_ITEM dwItem=%08lX;\n",
 				lpParms->dwItem);
 		switch(lpParms->dwItem) {
 			case MCI_GETDEVCAPS_CAN_RECORD:
@@ -168,8 +166,7 @@
 				return MCIERR_UNRECOGNIZED_COMMAND;
 			}
 		}
-	dprintf_info(mcianim,
-		"ANIM_mciGetDevCaps // lpParms->dwReturn=%08lX;\n", 
+	TRACE(mcianim, "lpParms->dwReturn=%08lX;\n", 
 		lpParms->dwReturn);
  	return 0;
 #else
@@ -189,14 +186,13 @@
 	UINT16	wMinutes;
 	UINT16	wSeconds;
 	UINT16	wFrames;
-	dprintf_info(mcianim,"ANIM_CalcTime(%u, %08lX, %lu);\n", 
+	TRACE(mcianim,"(%u, %08lX, %lu);\n", 
 			wDevID, dwFormatType, dwFrame);
     
 	switch (dwFormatType) {
 		case MCI_FORMAT_MILLISECONDS:
 			dwTime = dwFrame / ANIMFRAMES_PERSEC * 1000;
-			dprintf_info(mcianim,
-				"ANIM_CalcTime // MILLISECONDS %lu\n", dwTime);
+			TRACE(mcianim, "MILLISECONDS %lu\n", dwTime);
 			break;
 		case MCI_FORMAT_MSF:
 			wMinutes = dwFrame / ANIMFRAMES_PERMIN;
@@ -204,7 +200,7 @@
 			wFrames = dwFrame - ANIMFRAMES_PERMIN * wMinutes - 
 								ANIMFRAMES_PERSEC * wSeconds;
 			dwTime = MCI_MAKE_MSF(wMinutes, wSeconds, wFrames);
-			dprintf_info(mcianim,"ANIM_CalcTime // MSF %02u:%02u:%02u -> dwTime=%lu\n",
+			TRACE(mcianim,"MSF %02u:%02u:%02u -> dwTime=%lu\n",
 								wMinutes, wSeconds, wFrames, dwTime);
 			break;
 		default:
@@ -222,8 +218,7 @@
 			wFrames = dwFrame - ANIMFRAMES_PERMIN * wMinutes - 
 								ANIMFRAMES_PERSEC * wSeconds;
 			dwTime = MCI_MAKE_TMSF(wTrack, wMinutes, wSeconds, wFrames);
-			dprintf_info(mcianim,
-				"ANIM_CalcTime // %02u-%02u:%02u:%02u\n",
+			TRACE(mcianim, "%02u-%02u:%02u:%02u\n",
 				wTrack, wMinutes, wSeconds, wFrames);
 			break;
 		}
@@ -240,18 +235,16 @@
 	DWORD	dwFrame = 0;
 #if defined(linux) || defined(__FreeBSD__)
 	UINT16	wTrack;
-	dprintf_info(mcianim,"ANIM_CalcFrame(%u, %08lX, %lu);\n", 
+	TRACE(mcianim,"(%u, %08lX, %lu);\n", 
 			wDevID, dwFormatType, dwTime);
 
         switch (dwFormatType) {
 		case MCI_FORMAT_MILLISECONDS:
 			dwFrame = dwTime * ANIMFRAMES_PERSEC / 1000;
-			dprintf_info(mcianim,
-				"ANIM_CalcFrame // MILLISECONDS %lu\n", dwFrame);
+			TRACE(mcianim, "MILLISECONDS %lu\n", dwFrame);
 			break;
 		case MCI_FORMAT_MSF:
-			dprintf_info(mcianim,
-				"ANIM_CalcFrame // MSF %02u:%02u:%02u\n",
+			TRACE(mcianim, "MSF %02u:%02u:%02u\n",
 				MCI_MSF_MINUTE(dwTime), MCI_MSF_SECOND(dwTime), 
 				MCI_MSF_FRAME(dwTime));
 			dwFrame += ANIMFRAMES_PERMIN * MCI_MSF_MINUTE(dwTime);
@@ -263,12 +256,10 @@
 			dwFormatType = MCI_FORMAT_TMSF;
 		case MCI_FORMAT_TMSF:
 			wTrack = MCI_TMSF_TRACK(dwTime);
-			dprintf_info(mcianim,
-				"ANIM_CalcFrame // TMSF %02u-%02u:%02u:%02u\n",
+			TRACE(mcianim, "TMSF %02u-%02u:%02u:%02u\n",
 				MCI_TMSF_TRACK(dwTime), MCI_TMSF_MINUTE(dwTime), 
 				MCI_TMSF_SECOND(dwTime), MCI_TMSF_FRAME(dwTime));
-			dprintf_info(mcianim,
-				"ANIM_CalcFrame // TMSF trackpos[%u]=%lu\n",
+			TRACE(mcianim, "TMSF trackpos[%u]=%lu\n",
 				wTrack, AnimDev[wDevID].lpdwTrackPos[wTrack - 1]);
 			dwFrame = AnimDev[wDevID].lpdwTrackPos[wTrack - 1];
 			dwFrame += ANIMFRAMES_PERMIN * MCI_TMSF_MINUTE(dwTime);
@@ -287,7 +278,7 @@
 static DWORD ANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(mcianim,"ANIM_mciInfo(%u, %08lX, %p);\n", 
+	TRACE(mcianim,"(%u, %08lX, %p);\n", 
 		wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	lpParms->lpstrReturn = NULL;
@@ -321,12 +312,11 @@
 static DWORD ANIM_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(mcianim,"ANIM_mciStatus(%u, %08lX, %p);\n", 
+	TRACE(mcianim,"(%u, %08lX, %p);\n", 
 			wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (dwFlags & MCI_NOTIFY) {
-		dprintf_info(mcianim,
-			"ANIM_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+		TRACE(mcianim, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 			lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
@@ -335,11 +325,11 @@
 		switch(lpParms->dwItem) {
 			case MCI_STATUS_CURRENT_TRACK:
 				lpParms->dwReturn = AnimDev[wDevID].nCurTrack;
-				dprintf_info(mcianim,"ANIM_mciStatus // CURRENT_TRACK=%lu!\n", lpParms->dwReturn);
+				TRACE(mcianim,"CURRENT_TRACK=%lu!\n", lpParms->dwReturn);
 			 	return 0;
 			case MCI_STATUS_LENGTH:
 				if (dwFlags & MCI_TRACK) {
-					dprintf_info(mcianim,"ANIM_mciStatus // MCI_TRACK #%lu LENGTH=??? !\n",
+					TRACE(mcianim,"MCI_TRACK #%lu LENGTH=??? !\n",
 														lpParms->dwTrack);
 					if (lpParms->dwTrack > AnimDev[wDevID].nTracks)
 						return MCIERR_OUTOFRANGE;
@@ -349,20 +339,20 @@
 					lpParms->dwReturn = AnimDev[wDevID].dwTotalLen;
 				lpParms->dwReturn = ANIM_CalcTime(wDevID, 
 					AnimDev[wDevID].dwTimeFormat, lpParms->dwReturn);
-                		dprintf_info(mcianim,"ANIM_mciStatus // LENGTH=%lu !\n", lpParms->dwReturn);
+                		TRACE(mcianim,"LENGTH=%lu !\n", lpParms->dwReturn);
 			 	return 0;
 			case MCI_STATUS_MODE:
 				lpParms->dwReturn = AnimDev[wDevID].mode;
-				dprintf_info(mcianim,"ANIM_mciStatus // MCI_STATUS_MODE=%08lX !\n",
+				TRACE(mcianim,"MCI_STATUS_MODE=%08lX !\n",
 												lpParms->dwReturn);
 			 	return 0;
 			case MCI_STATUS_MEDIA_PRESENT:
 				lpParms->dwReturn = TRUE;
-				dprintf_info(mcianim,"ANIM_mciStatus // MCI_STATUS_MEDIA_PRESENT !\n");
+				TRACE(mcianim,"MCI_STATUS_MEDIA_PRESENT !\n");
 			 	return 0;
 			case MCI_STATUS_NUMBER_OF_TRACKS:
 				lpParms->dwReturn = 1;
-				dprintf_info(mcianim,"ANIM_mciStatus // MCI_STATUS_NUMBER_OF_TRACKS = %lu !\n",
+				TRACE(mcianim,"MCI_STATUS_NUMBER_OF_TRACKS = %lu !\n",
 											lpParms->dwReturn);
 				if (lpParms->dwReturn == (WORD)-1) return MCIERR_INTERNAL;
 			 	return 0;
@@ -370,25 +360,25 @@
 				lpParms->dwReturn = AnimDev[wDevID].dwCurFrame;
 				if (dwFlags & MCI_STATUS_START) {
 					lpParms->dwReturn = 0;
-					dprintf_info(mcianim,"CDAUDIO_mciStatus // get MCI_STATUS_START !\n");
+					TRACE(mcianim,"get MCI_STATUS_START !\n");
 					}
 				if (dwFlags & MCI_TRACK) {
 					if (lpParms->dwTrack > AnimDev[wDevID].nTracks)
 						return MCIERR_OUTOFRANGE;
 					lpParms->dwReturn = AnimDev[wDevID].lpdwTrackPos[lpParms->dwTrack - 1];
-					dprintf_info(mcianim,"ANIM_mciStatus // get MCI_TRACK #%lu !\n", lpParms->dwTrack);
+					TRACE(mcianim,"get MCI_TRACK #%lu !\n", lpParms->dwTrack);
 					}
 				lpParms->dwReturn = ANIM_CalcTime(wDevID, 
 					AnimDev[wDevID].dwTimeFormat, lpParms->dwReturn);
-					dprintf_info(mcianim,"ANIM_mciStatus // MCI_STATUS_POSITION=%08lX !\n",
+					TRACE(mcianim,"MCI_STATUS_POSITION=%08lX !\n",
 														lpParms->dwReturn);
 			 	return 0;
 			case MCI_STATUS_READY:
-				dprintf_info(mcianim,"ANIM_mciStatus // MCI_STATUS_READY !\n");
+				TRACE(mcianim,"MCI_STATUS_READY !\n");
 				lpParms->dwReturn = TRUE;
 			 	return 0;
 			case MCI_STATUS_TIME_FORMAT:
-				dprintf_info(mcianim,"ANIM_mciStatus // MCI_STATUS_TIME_FORMAT !\n");
+				TRACE(mcianim,"MCI_STATUS_TIME_FORMAT !\n");
 				lpParms->dwReturn = MCI_FORMAT_MILLISECONDS;
 			 	return 0;
 			default:
@@ -411,7 +401,7 @@
 {
 #if defined(linux) || defined(__FreeBSD__)
 	int 	start, end;
-	dprintf_info(mcianim,"ANIM_mciPlay(%u, %08lX, %p);\n", 
+	TRACE(mcianim,"(%u, %08lX, %p);\n", 
 		wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	start = 0; 		end = AnimDev[wDevID].dwTotalLen;
@@ -419,20 +409,18 @@
 	if (dwFlags & MCI_FROM) {
 		start = ANIM_CalcFrame(wDevID, 
 			AnimDev[wDevID].dwTimeFormat, lpParms->dwFrom); 
-        dprintf_info(mcianim,"ANIM_mciPlay // MCI_FROM=%08lX -> %u \n",
+        TRACE(mcianim,"MCI_FROM=%08lX -> %u \n",
 				lpParms->dwFrom, start);
 		}
 	if (dwFlags & MCI_TO) {
 		end = ANIM_CalcFrame(wDevID, 
 			AnimDev[wDevID].dwTimeFormat, lpParms->dwTo);
-        	dprintf_info(mcianim,
-			"ANIM_mciPlay // MCI_TO=%08lX -> %u \n",
+        	TRACE(mcianim, "MCI_TO=%08lX -> %u \n",
 			lpParms->dwTo, end);
 		}
 	AnimDev[wDevID].mode = MCI_MODE_PLAY;
 	if (dwFlags & MCI_NOTIFY) {
-		dprintf_info(mcianim,
-			"ANIM_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+		TRACE(mcianim, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 			lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
@@ -449,13 +437,12 @@
 static DWORD ANIM_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(mcianim,"ANIM_mciStop(%u, %08lX, %p);\n", 
+	TRACE(mcianim,"(%u, %08lX, %p);\n", 
 			wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	AnimDev[wDevID].mode = MCI_MODE_STOP;
 	if (dwFlags & MCI_NOTIFY) {
-		dprintf_info(mcianim,
-			"ANIM_mciStop // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+		TRACE(mcianim, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 			lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
@@ -472,13 +459,12 @@
 static DWORD ANIM_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(mcianim,"ANIM_mciPause(%u, %08lX, %p);\n", 
+	TRACE(mcianim,"(%u, %08lX, %p);\n", 
 		wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	AnimDev[wDevID].mode = MCI_MODE_PAUSE;
 	if (dwFlags & MCI_NOTIFY) {
-		dprintf_info(mcianim,
-			"ANIM_mciPause // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+		TRACE(mcianim, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 			lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
@@ -495,13 +481,12 @@
 static DWORD ANIM_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(mcianim,"ANIM_mciResume(%u, %08lX, %p);\n", 
+	TRACE(mcianim,"(%u, %08lX, %p);\n", 
 		wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	AnimDev[wDevID].mode = MCI_MODE_STOP;
 	if (dwFlags & MCI_NOTIFY) {
-		dprintf_info(mcianim,
-			"ANIM_mciResume // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+		TRACE(mcianim, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 			lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
@@ -520,7 +505,7 @@
 #if defined(linux) || defined(__FreeBSD__)
 	DWORD	dwRet;
 	MCI_PLAY_PARMS PlayParms;
-	dprintf_info(mcianim,"ANIM_mciSeek(%u, %08lX, %p);\n", 
+	TRACE(mcianim,"(%u, %08lX, %p);\n", 
 		wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	AnimDev[wDevID].mode = MCI_MODE_SEEK;
@@ -539,8 +524,7 @@
 	if (dwRet != 0) return dwRet;
 	dwRet = ANIM_mciStop(wDevID, MCI_WAIT, (LPMCI_GENERIC_PARMS)&PlayParms);
 	if (dwFlags & MCI_NOTIFY) {
-		dprintf_info(mcianim,
-			"ANIM_mciSeek // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+		TRACE(mcianim, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 			lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
@@ -558,7 +542,7 @@
 static DWORD ANIM_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(mcianim,"ANIM_mciSet(%u, %08lX, %p);\n", 
+	TRACE(mcianim,"(%u, %08lX, %p);\n", 
 		wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 /*
@@ -568,14 +552,13 @@
 	if (dwFlags & MCI_SET_TIME_FORMAT) {
 		switch (lpParms->dwTimeFormat) {
 			case MCI_FORMAT_MILLISECONDS:
-				dprintf_info(mcianim,
-					"ANIM_mciSet // MCI_FORMAT_MILLISECONDS !\n");
+				TRACE(mcianim, "MCI_FORMAT_MILLISECONDS !\n");
 				break;
 			case MCI_FORMAT_MSF:
-				dprintf_info(mcianim,"ANIM_mciSet // MCI_FORMAT_MSF !\n");
+				TRACE(mcianim,"MCI_FORMAT_MSF !\n");
 				break;
 			case MCI_FORMAT_TMSF:
-				dprintf_info(mcianim,"ANIM_mciSet // MCI_FORMAT_TMSF !\n");
+				TRACE(mcianim,"MCI_FORMAT_TMSF !\n");
 				break;
 			default:
 				fprintf(stderr,"ANIM_mciSet // bad time format !\n");
@@ -587,8 +570,7 @@
 	if (dwFlags & MCI_SET_ON) return MCIERR_UNSUPPORTED_FUNCTION;
 	if (dwFlags & MCI_SET_OFF) return MCIERR_UNSUPPORTED_FUNCTION;
 	if (dwFlags & MCI_NOTIFY) {
-		dprintf_info(mcianim,
-			"ANIM_mciSet // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+		TRACE(mcianim, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 			lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			AnimDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
diff --git a/multimedia/mcicda.c b/multimedia/mcicda.c
index 7c43b7d..a3fa04f 100644
--- a/multimedia/mcicda.c
+++ b/multimedia/mcicda.c
@@ -24,7 +24,6 @@
 #include <sys/cdio.h>
 #endif
 
-#define SOUND_DEV "/dev/dsp"
 #ifdef __FreeBSD__
 #define CDAUDIO_DEV "/dev/rcd0c"
 #else
@@ -95,9 +94,8 @@
 			  CDIOREADTOCHEADER
 #endif
 			  , &hdr)) {
-            		dprintf_warn(cdaudio,
-				"GetNumberOfTracks(%04X) // Error occured !\n", 
-				wDevID);
+            		WARN(cdaudio, "(%04X) -- Error occured !\n", 
+				     wDevID);
 			return (WORD)-1;
 			}
 #ifdef linux
@@ -132,7 +130,7 @@
 	if (CDADev[wDevID].nTracks == 0) {
 		if (CDAUDIO_GetNumberOfTracks(wDevID) == (WORD)-1) return FALSE;
 		}
-    	dprintf_info(cdaudio,"CDAUDIO_GetTracksInfo // nTracks=%u\n", 
+    	TRACE(cdaudio,"nTracks=%u\n", 
 		CDADev[wDevID].nTracks);
 	if (CDADev[wDevID].lpdwTrackLen != NULL) 
 		free(CDADev[wDevID].lpdwTrackLen);
@@ -144,8 +142,7 @@
 		(CDADev[wDevID].nTracks + 1) * sizeof(DWORD));
 	if (CDADev[wDevID].lpdwTrackLen == NULL ||
 		CDADev[wDevID].lpdwTrackPos == NULL) {
-        		dprintf_warn(cdaudio,
-				"CDAUDIO_GetTracksInfo // error allocating track table !\n");
+        		WARN(cdaudio, "error allocating track table !\n");
 		return FALSE;
 		}
 	memset(CDADev[wDevID].lpdwTrackLen, 0, 
@@ -181,8 +178,7 @@
 			  CDIOREADTOCENTRYS
 #endif
 			  , &entry)) {
-            		dprintf_warn(cdaudio,
-				"CDAUDIO_GetTracksInfo // error read entry\n");
+            		WARN(cdaudio, "error read entry\n");
 			return FALSE;
 			}
 #ifdef linux
@@ -197,8 +193,7 @@
 		if (i == 0) {
 			last_start = start;
 			CDADev[wDevID].dwFirstOffset = start;
-            		dprintf_info(cdaudio,
-				"CDAUDIO_GetTracksInfo // dwFirstOffset=%u\n", 
+            		TRACE(cdaudio, "dwFirstOffset=%u\n", 
 				start);
 			}
 		else {
@@ -208,13 +203,12 @@
 			total_length += length;
 			CDADev[wDevID].lpdwTrackLen[i - 1] = length;
 			CDADev[wDevID].lpdwTrackPos[i - 1] = start;
-            		dprintf_info(cdaudio,
-			"CDAUDIO_GetTracksInfo // track #%u start=%u len=%u\n",
-				i, start, length);
+            		TRACE(cdaudio, "track #%u start=%u len=%u\n",
+				     i, start, length);
 			}
 		}
 	CDADev[wDevID].dwTotalLen = total_length;
-    	dprintf_info(cdaudio,"CDAUDIO_GetTracksInfo // total_len=%u\n", 
+    	TRACE(cdaudio,"total_len=%u\n", 
 		total_length);
 	return TRUE;
 #else
@@ -229,7 +223,7 @@
 static DWORD CDAUDIO_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS16 lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-    	dprintf_info(cdaudio,"CDAUDIO_mciOpen(%04X, %08lX, %p);\n", 
+    	TRACE(cdaudio,"(%04X, %08lX, %p);\n", 
 					wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 
@@ -247,14 +241,14 @@
 		CDADev[wDevID].fShareable = dwFlags & MCI_OPEN_SHAREABLE;
 		}
     if (dwFlags & MCI_OPEN_ELEMENT) {
-		dprintf_info(cdaudio,"CDAUDIO_mciOpen // MCI_OPEN_ELEMENT !\n");
+		TRACE(cdaudio,"MCI_OPEN_ELEMENT !\n");
 /*		return MCIERR_NO_ELEMENT_ALLOWED; */
 		}
 	memcpy(&CDADev[wDevID].openParms, lpParms, sizeof(MCI_OPEN_PARMS16));
 	CDADev[wDevID].wNotifyDeviceID = lpParms->wDeviceID;
 	CDADev[wDevID].unixdev = open (CDAUDIO_DEV, O_RDONLY, 0);
 	if (CDADev[wDevID].unixdev == -1) {
-		dprintf_warn(cdaudio,"CDAUDIO_mciOpen // can't open '%s' !\n", CDAUDIO_DEV);
+		WARN(cdaudio,"can't open '%s' !\n", CDAUDIO_DEV);
 		return MCIERR_HARDWARE;
 		}
 	CDADev[wDevID].mode = 0;
@@ -266,7 +260,7 @@
 	CDADev[wDevID].lpdwTrackLen = NULL;
 	CDADev[wDevID].lpdwTrackPos = NULL;
 	if (!CDAUDIO_GetTracksInfo(wDevID)) {
-		dprintf_warn(cdaudio,"CDAUDIO_mciOpen // error reading TracksInfo !\n");
+		WARN(cdaudio,"error reading TracksInfo !\n");
 /*		return MCIERR_INTERNAL; */
 		}
 
@@ -274,8 +268,7 @@
    Moved to mmsystem.c mciOpen routine
 
 	if (dwFlags & MCI_NOTIFY) {
-        	dprintf_info(cdaudio,
-			"CDAUDIO_mciOpen // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+        	TRACE(cdaudio, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 			lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
@@ -293,7 +286,7 @@
 static DWORD CDAUDIO_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-    	dprintf_info(cdaudio,"CDAUDIO_mciClose(%04X, %08lX, %p);\n", 
+    	TRACE(cdaudio,"(%04X, %08lX, %p);\n", 
 		wDevID, dwParam, lpParms);
 	if (CDADev[wDevID].lpdwTrackLen != NULL) free(CDADev[wDevID].lpdwTrackLen);
 	if (CDADev[wDevID].lpdwTrackPos != NULL) free(CDADev[wDevID].lpdwTrackPos);
@@ -309,13 +302,12 @@
 						LPMCI_GETDEVCAPS_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-    	dprintf_info(cdaudio,"CDAUDIO_mciGetDevCaps(%04X, %08lX, %p);\n", 
+    	TRACE(cdaudio,"(%04X, %08lX, %p);\n", 
 		wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (dwFlags & MCI_GETDEVCAPS_ITEM) {
-        	dprintf_info(cdaudio,
-		"CDAUDIO_mciGetDevCaps // MCI_GETDEVCAPS_ITEM dwItem=%08lX;\n",
-				lpParms->dwItem);
+        	TRACE(cdaudio, "MCI_GETDEVCAPS_ITEM dwItem=%08lX;\n",
+			     lpParms->dwItem);
 		switch(lpParms->dwItem) {
 			case MCI_GETDEVCAPS_CAN_RECORD:
 				lpParms->dwReturn = FALSE;
@@ -348,8 +340,7 @@
 				return MCIERR_UNRECOGNIZED_COMMAND;
 			}
 		}
-    	dprintf_info(cdaudio,
-		"CDAUDIO_mciGetDevCaps // lpParms->dwReturn=%08lX;\n", 
+    	TRACE(cdaudio, "lpParms->dwReturn=%08lX;\n", 
 		lpParms->dwReturn);
  	return 0;
 #else
@@ -363,7 +354,7 @@
 static DWORD CDAUDIO_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-    	dprintf_info(cdaudio,"CDAUDIO_mciInfo(%04X, %08lX, %p);\n", 
+    	TRACE(cdaudio,"(%04X, %08lX, %p);\n", 
 		wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	lpParms->lpstrReturn = NULL;
@@ -394,19 +385,17 @@
 #if defined(linux) || defined(__FreeBSD__)
 	UINT16	wTrack;
     
-    	dprintf_info(cdaudio,"CDAUDIO_CalcFrame(%04X, %08lX, %lu);\n", 
+    	TRACE(cdaudio,"(%04X, %08lX, %lu);\n", 
 		wDevID, dwFormatType, dwTime);
     
 	switch (dwFormatType) {
 		case MCI_FORMAT_MILLISECONDS:
 			dwFrame = dwTime * CDFRAMES_PERSEC / 1000;
-            		dprintf_info(cdaudio,
-				"CDAUDIO_CalcFrame // MILLISECONDS %lu\n", 
+            		TRACE(cdaudio, "MILLISECONDS %lu\n", 
 				dwFrame);
 			break;
 		case MCI_FORMAT_MSF:
-            		dprintf_info(cdaudio,
-				"CDAUDIO_CalcFrame // MSF %02u:%02u:%02u\n",
+            		TRACE(cdaudio, "MSF %02u:%02u:%02u\n",
 				MCI_MSF_MINUTE(dwTime), MCI_MSF_SECOND(dwTime), 
 				MCI_MSF_FRAME(dwTime));
 			dwFrame += CDFRAMES_PERMIN * MCI_MSF_MINUTE(dwTime);
@@ -418,12 +407,10 @@
 			dwFormatType = MCI_FORMAT_TMSF;
 		case MCI_FORMAT_TMSF:
 			wTrack = MCI_TMSF_TRACK(dwTime);
-            		dprintf_info(cdaudio,
-			"CDAUDIO_CalcFrame // TMSF %02u-%02u:%02u:%02u\n",
+            		TRACE(cdaudio, "MSF %02u-%02u:%02u:%02u\n",
 					MCI_TMSF_TRACK(dwTime), MCI_TMSF_MINUTE(dwTime), 
 					MCI_TMSF_SECOND(dwTime), MCI_TMSF_FRAME(dwTime));
-            		dprintf_info(cdaudio,
-				"CDAUDIO_CalcFrame // TMSF trackpos[%u]=%lu\n",
+            		TRACE(cdaudio, "TMSF trackpos[%u]=%lu\n",
 				wTrack, CDADev[wDevID].lpdwTrackPos[wTrack - 1]);
 			dwFrame = CDADev[wDevID].lpdwTrackPos[wTrack - 1];
 			dwFrame += CDFRAMES_PERMIN * MCI_TMSF_MINUTE(dwTime);
@@ -461,7 +448,7 @@
 		  CDIOCREADSUBCHANNEL, &read_sc
 #endif
 		  )) {
-        	dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // opened or no_media !\n");
+        	TRACE(cdaudio,"opened or no_media !\n");
 		CDADev[wDevID].mode = MCI_MODE_NOT_READY;
 		return TRUE;
 		}
@@ -477,7 +464,7 @@
 #elif __FreeBSD__
 		case CD_AS_AUDIO_INVALID:
 #endif
-            		dprintf_warn(cdaudio, "CDAUDIO_GetCDStatus // device doesn't support status, returning NOT_READY.\n");
+            		WARN(cdaudio, "device doesn't support status, returning NOT_READY.\n");
 #ifdef linux
 			CDADev[wDevID].mode = MCI_MODE_NOT_READY;
 #elif __FreeBSD__
@@ -490,7 +477,7 @@
 		case CD_AS_NO_STATUS:
 #endif
 			CDADev[wDevID].mode = MCI_MODE_STOP;
-            		dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // MCI_MODE_STOP !\n");
+            		TRACE(cdaudio,"MCI_MODE_STOP !\n");
 			break;
 #ifdef linux
 		case CDROM_AUDIO_PLAY: 
@@ -498,7 +485,7 @@
 		case CD_AS_PLAY_IN_PROGRESS:
 #endif
 			CDADev[wDevID].mode = MCI_MODE_PLAY;
-            		dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // MCI_MODE_PLAY !\n");
+            		TRACE(cdaudio,"MCI_MODE_PLAY !\n");
 			break;
 #ifdef linux
 		case CDROM_AUDIO_PAUSED:
@@ -506,14 +493,14 @@
 		case CD_AS_PLAY_PAUSED:
 #endif
 			CDADev[wDevID].mode = MCI_MODE_PAUSE;
-            		dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // MCI_MODE_PAUSE !\n");
+            		TRACE(cdaudio,"MCI_MODE_PAUSE !\n");
 			break;
 		default:
 #ifdef linux
-            		dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // status=%02X !\n",
+            		TRACE(cdaudio,"status=%02X !\n",
 				     CDADev[wDevID].sc.cdsc_audiostatus);
 #elif __FreeBSD__
-            		dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // status=%02X !\n",
+            		TRACE(cdaudio,"status=%02X !\n",
 				     CDADev[wDevID].sc.header.audio_status);
 #endif
 		}
@@ -531,13 +518,13 @@
 		CDADev[wDevID].sc.what.position.absaddr.msf.frame;
 #endif
 #ifdef linux
-    	dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // %02u-%02u:%02u:%02u \n",
+    	TRACE(cdaudio,"%02u-%02u:%02u:%02u \n",
 		     CDADev[wDevID].sc.cdsc_trk,
 		     CDADev[wDevID].sc.cdsc_absaddr.msf.minute,
 		     CDADev[wDevID].sc.cdsc_absaddr.msf.second,
 		     CDADev[wDevID].sc.cdsc_absaddr.msf.frame);
 #elif __FreeBSD__
-    	dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // %02u-%02u:%02u:%02u \n",
+    	TRACE(cdaudio,"%02u-%02u:%02u:%02u \n",
 		     CDADev[wDevID].sc.what.position.track_number,
 		     CDADev[wDevID].sc.what.position.absaddr.msf.minute,
 		     CDADev[wDevID].sc.what.position.absaddr.msf.second,
@@ -546,7 +533,7 @@
 			
 	if (oldmode != CDADev[wDevID].mode && oldmode == MCI_MODE_OPEN) {
 		if (!CDAUDIO_GetTracksInfo(wDevID)) {
-		  dprintf_warn(cdaudio, "CDAUDIO_GetCDStatus // error updating TracksInfo !\n");
+		  WARN(cdaudio, "error updating TracksInfo !\n");
 			return MCIERR_INTERNAL;
 			}
 		}
@@ -569,14 +556,13 @@
 	UINT16	wSeconds;
 	UINT16	wFrames;
 
-    	dprintf_info(cdaudio,"CDAUDIO_CalcTime(%04X, %08lX, %lu);\n", 
+    	TRACE(cdaudio,"(%04X, %08lX, %lu);\n", 
 		wDevID, dwFormatType, dwFrame);
 
 	switch (dwFormatType) {
 		case MCI_FORMAT_MILLISECONDS:
 			dwTime = dwFrame / CDFRAMES_PERSEC * 1000;
-            		dprintf_info(cdaudio,
-				"CDAUDIO_CalcTime // MILLISECONDS %lu\n", 
+            		TRACE(cdaudio, "MILLISECONDS %lu\n", 
 				dwTime);
 			break;
 		case MCI_FORMAT_MSF:
@@ -585,7 +571,7 @@
 			wFrames = dwFrame - CDFRAMES_PERMIN * wMinutes - 
 								CDFRAMES_PERSEC * wSeconds;
 			dwTime = MCI_MAKE_MSF(wMinutes, wSeconds, wFrames);
-            		dprintf_info(cdaudio,"CDAUDIO_CalcTime // MSF %02u:%02u:%02u -> dwTime=%lu\n",
+            		TRACE(cdaudio,"MSF %02u:%02u:%02u -> dwTime=%lu\n",
 								wMinutes, wSeconds, wFrames, dwTime);
 			break;
 		default:
@@ -603,8 +589,7 @@
 			wFrames = dwFrame - CDFRAMES_PERMIN * wMinutes - 
 								CDFRAMES_PERSEC * wSeconds;
 			dwTime = MCI_MAKE_TMSF(wTrack, wMinutes, wSeconds, wFrames);
-            		dprintf_info(cdaudio,
-				"CDAUDIO_CalcTime // %02u-%02u:%02u:%02u\n",
+            		TRACE(cdaudio, "%02u-%02u:%02u:%02u\n",
 					wTrack, wMinutes, wSeconds, wFrames);
 			break;
 		}
@@ -619,13 +604,12 @@
 static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-    	dprintf_info(cdaudio,"CDAUDIO_mciStatus(%04X, %08lX, %p);\n", 
+    	TRACE(cdaudio,"(%04X, %08lX, %p);\n", 
 		wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (CDADev[wDevID].unixdev == 0) return MMSYSERR_NOTENABLED;
 	if (dwFlags & MCI_NOTIFY) {
-        	dprintf_info(cdaudio,
-			"CDAUDIO_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+        	TRACE(cdaudio, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 			lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
@@ -635,17 +619,17 @@
 			case MCI_STATUS_CURRENT_TRACK:
 				if (!CDAUDIO_GetCDStatus(wDevID)) return MCIERR_INTERNAL;
 				lpParms->dwReturn = CDADev[wDevID].nCurTrack;
-                		dprintf_info(cdaudio,"CDAUDIO_mciStatus // CURRENT_TRACK=%lu!\n", lpParms->dwReturn);
+                		TRACE(cdaudio,"CURRENT_TRACK=%lu!\n", lpParms->dwReturn);
 			 	return 0;
 			case MCI_STATUS_LENGTH:
 				if (CDADev[wDevID].nTracks == 0) {
 					if (!CDAUDIO_GetTracksInfo(wDevID)) {
-                        			dprintf_warn(cdaudio, "CDAUDIO_mciStatus // error reading TracksInfo !\n");
+                        			WARN(cdaudio, "error reading TracksInfo !\n");
 						return MCIERR_INTERNAL;
 						}
 					}
 				if (dwFlags & MCI_TRACK) {
-					dprintf_info(cdaudio,"CDAUDIO_mciStatus // MCI_TRACK #%lu LENGTH=??? !\n",
+					TRACE(cdaudio,"MCI_TRACK #%lu LENGTH=??? !\n",
 							lpParms->dwTrack);
 					if (lpParms->dwTrack > CDADev[wDevID].nTracks)
 						return MCIERR_OUTOFRANGE;
@@ -655,24 +639,24 @@
 					lpParms->dwReturn = CDADev[wDevID].dwTotalLen;
 				lpParms->dwReturn = CDAUDIO_CalcTime(wDevID, 
 					CDADev[wDevID].dwTimeFormat, lpParms->dwReturn);
-                		dprintf_info(cdaudio,"CDAUDIO_mciStatus // LENGTH=%lu !\n", lpParms->dwReturn);
+                		TRACE(cdaudio,"LENGTH=%lu !\n", lpParms->dwReturn);
 			 	return 0;
 			case MCI_STATUS_MODE:
 				if (!CDAUDIO_GetCDStatus(wDevID)) return MCIERR_INTERNAL;
 				lpParms->dwReturn = CDADev[wDevID].mode;
-                		dprintf_info(cdaudio,"CDAUDIO_mciStatus // MCI_STATUS_MODE=%08lX !\n",
+                		TRACE(cdaudio,"MCI_STATUS_MODE=%08lX !\n",
 												lpParms->dwReturn);
 			 	return 0;
 			case MCI_STATUS_MEDIA_PRESENT:
 				lpParms->dwReturn = (CDADev[wDevID].nTracks > 0) ? TRUE : FALSE;
 				if (lpParms->dwReturn == FALSE)
-                    			dprintf_info(cdaudio,"CDAUDIO_mciStatus // MEDIA_NOT_PRESENT !\n");
+                    			TRACE(cdaudio,"MEDIA_NOT_PRESENT !\n");
 				else
-                    			dprintf_info(cdaudio,"CDAUDIO_mciStatus // MCI_STATUS_MEDIA_PRESENT !\n");
+                    			TRACE(cdaudio,"MCI_STATUS_MEDIA_PRESENT !\n");
 			 	return 0;
 			case MCI_STATUS_NUMBER_OF_TRACKS:
 				lpParms->dwReturn = CDAUDIO_GetNumberOfTracks(wDevID);
-                		dprintf_info(cdaudio,"CDAUDIO_mciStatus // MCI_STATUS_NUMBER_OF_TRACKS = %lu !\n",
+                		TRACE(cdaudio,"MCI_STATUS_NUMBER_OF_TRACKS = %lu !\n",
 													lpParms->dwReturn);
 				if (lpParms->dwReturn == (WORD)-1) return MCIERR_INTERNAL;
 			 	return 0;
@@ -681,33 +665,33 @@
 				lpParms->dwReturn = CDADev[wDevID].dwCurFrame;
 				if (dwFlags & MCI_STATUS_START) {
 					lpParms->dwReturn = CDADev[wDevID].dwFirstOffset;
-                    			dprintf_info(cdaudio,"CDAUDIO_mciStatus // get MCI_STATUS_START !\n");
+                    			TRACE(cdaudio,"get MCI_STATUS_START !\n");
 					}
 				if (dwFlags & MCI_TRACK) {
 					if (lpParms->dwTrack > CDADev[wDevID].nTracks)
 						return MCIERR_OUTOFRANGE;
 					lpParms->dwReturn = CDADev[wDevID].lpdwTrackPos[lpParms->dwTrack - 1];
-                    			dprintf_info(cdaudio,"CDAUDIO_mciStatus // get MCI_TRACK #%lu !\n", lpParms->dwTrack);
+                    			TRACE(cdaudio,"get MCI_TRACK #%lu !\n", lpParms->dwTrack);
 					}
 				lpParms->dwReturn = CDAUDIO_CalcTime(wDevID,
 					CDADev[wDevID].dwTimeFormat, lpParms->dwReturn);
-                			dprintf_info(cdaudio,"CDAUDIO_mciStatus // MCI_STATUS_POSITION=%08lX !\n",
+                			TRACE(cdaudio,"MCI_STATUS_POSITION=%08lX !\n",
 														lpParms->dwReturn);
 			 	return 0;
 			case MCI_STATUS_READY:
-                		dprintf_info(cdaudio,"CDAUDIO_mciStatus // MCI_STATUS_READY !\n");
+                		TRACE(cdaudio,"MCI_STATUS_READY !\n");
 				lpParms->dwReturn = TRUE;
 			 	return 0;
 			case MCI_STATUS_TIME_FORMAT:
-                		dprintf_info(cdaudio,"CDAUDIO_mciStatus // MCI_STATUS_TIME_FORMAT !\n");
+                		TRACE(cdaudio,"MCI_STATUS_TIME_FORMAT !\n");
 				lpParms->dwReturn = CDADev[wDevID].dwTimeFormat;
 			 	return 0;
 			default:
-                		dprintf_warn(cdaudio, "CDAUDIO_mciStatus // unknown command %08lX !\n", lpParms->dwItem);
+                		WARN(cdaudio, "unknown command %08lX !\n", lpParms->dwItem);
 				return MCIERR_UNRECOGNIZED_COMMAND;
 			}
 		}
-	dprintf_warn(cdaudio, "CDAUDIO_mciStatus // not MCI_STATUS_ITEM !\n");
+	WARN(cdaudio, "not MCI_STATUS_ITEM !\n");
  	return 0;
 #else
 	return MMSYSERR_NOTENABLED;
@@ -728,7 +712,7 @@
 	struct	ioc_play_msf	msf;
 #endif
 
-    	dprintf_info(cdaudio,"CDAUDIO_mciPlay(%04X, %08lX, %p);\n", 
+    	TRACE(cdaudio,"(%04X, %08lX, %p);\n", 
 		wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (CDADev[wDevID].unixdev == 0) return MMSYSERR_NOTENABLED;
@@ -737,14 +721,13 @@
 	if (dwFlags & MCI_FROM) {
 		start = CDAUDIO_CalcFrame(wDevID, 
 			CDADev[wDevID].dwTimeFormat, lpParms->dwFrom); 
-        dprintf_info(cdaudio,"CDAUDIO_mciPlay // MCI_FROM=%08lX -> %u \n",
+        TRACE(cdaudio,"MCI_FROM=%08lX -> %u \n",
 				lpParms->dwFrom, start);
 		}
 	if (dwFlags & MCI_TO) {
 		end = CDAUDIO_CalcFrame(wDevID, 
 			CDADev[wDevID].dwTimeFormat, lpParms->dwTo);
-        	dprintf_info(cdaudio,
-			"CDAUDIO_mciPlay // MCI_TO=%08lX -> %u \n",
+        	TRACE(cdaudio, "MCI_TO=%08lX -> %u \n",
 			lpParms->dwTo, end);
 		}
 	start += CDADev[wDevID].dwFirstOffset;	
@@ -771,7 +754,7 @@
 		  CDIOCSTART
 #endif
 		  )) {
-        	dprintf_warn(cdaudio, "CDAUDIO_mciPlay // motor doesn't start !\n");
+        	WARN(cdaudio, "motor doesn't start !\n");
 		return MCIERR_HARDWARE;
 		}
 	if (ioctl(CDADev[wDevID].unixdev, 
@@ -781,22 +764,21 @@
 		  CDIOCPLAYMSF
 #endif
 		  , &msf)) {
-        	dprintf_warn(cdaudio, "CDAUDIO_mciPlay // device doesn't play !\n");
+        	WARN(cdaudio, "device doesn't play !\n");
 		return MCIERR_HARDWARE;
 		}
 #ifdef linux
-    	dprintf_info(cdaudio,"CDAUDIO_mciPlay // msf = %d:%d:%d %d:%d:%d\n",
+    	TRACE(cdaudio,"msf = %d:%d:%d %d:%d:%d\n",
 		msf.cdmsf_min0, msf.cdmsf_sec0, msf.cdmsf_frame0,
 		msf.cdmsf_min1, msf.cdmsf_sec1, msf.cdmsf_frame1);
 #elif __FreeBSD__
-    	dprintf_info(cdaudio,"CDAUDIO_mciPlay // msf = %d:%d:%d %d:%d:%d\n",
+    	TRACE(cdaudio,"msf = %d:%d:%d %d:%d:%d\n",
 		msf.start_m, msf.start_s, msf.start_f,
 		msf.end_m,   msf.end_s,   msf.end_f);
 #endif
 	CDADev[wDevID].mode = MCI_MODE_PLAY;
 	if (dwFlags & MCI_NOTIFY) {
-        	dprintf_info(cdaudio,
-			"CDAUDIO_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+        	TRACE(cdaudio, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 			lpParms->dwCallback);
 /*
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
@@ -815,7 +797,7 @@
 static DWORD CDAUDIO_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-    	dprintf_info(cdaudio,"CDAUDIO_mciStop(%04X, %08lX, %p);\n", 
+    	TRACE(cdaudio,"(%04X, %08lX, %p);\n", 
 		wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (ioctl(CDADev[wDevID].unixdev,
@@ -827,8 +809,7 @@
 		  )) return MCIERR_HARDWARE;
 	CDADev[wDevID].mode = MCI_MODE_STOP;
 	if (dwFlags & MCI_NOTIFY) {
-        	dprintf_info(cdaudio,
-			"CDAUDIO_mciStop // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+        	TRACE(cdaudio, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 			lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
@@ -845,7 +826,7 @@
 static DWORD CDAUDIO_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-    	dprintf_info(cdaudio,"CDAUDIO_mciPause(%04X, %08lX, %p);\n", 
+    	TRACE(cdaudio,"(%04X, %08lX, %p);\n", 
 		wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (ioctl(CDADev[wDevID].unixdev,
@@ -857,8 +838,7 @@
 		  )) return MCIERR_HARDWARE;
 	CDADev[wDevID].mode = MCI_MODE_PAUSE;
 	if (dwFlags & MCI_NOTIFY) {
-        dprintf_info(cdaudio,
-		"CDAUDIO_mciPause // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+        TRACE(cdaudio, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 		lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
@@ -875,7 +855,7 @@
 static DWORD CDAUDIO_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-    	dprintf_info(cdaudio,"CDAUDIO_mciResume(%04X, %08lX, %p);\n", 
+    	TRACE(cdaudio,"(%04X, %08lX, %p);\n", 
 		wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (ioctl(CDADev[wDevID].unixdev, 
@@ -887,8 +867,7 @@
 		  )) return MCIERR_HARDWARE;
 	CDADev[wDevID].mode = MCI_MODE_STOP;
 	if (dwFlags & MCI_NOTIFY) {
-        	dprintf_info(cdaudio,
-			"CDAUDIO_mciResume // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+        	TRACE(cdaudio, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 			lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
@@ -907,7 +886,7 @@
 #if defined(linux) || defined(__FreeBSD__)
 	DWORD	dwRet;
 	MCI_PLAY_PARMS PlayParms;
-    	dprintf_info(cdaudio,"CDAUDIO_mciSeek(%04X, %08lX, %p);\n", 
+    	TRACE(cdaudio,"(%04X, %08lX, %p);\n", 
 		wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (ioctl(CDADev[wDevID].unixdev,
@@ -936,8 +915,7 @@
 	if (dwRet != 0) return dwRet;
 	dwRet = CDAUDIO_mciStop(wDevID, MCI_WAIT, (LPMCI_GENERIC_PARMS)&PlayParms);
 	if (dwFlags & MCI_NOTIFY) {
-        	dprintf_info(cdaudio,
-			"CDAUDIO_mciSeek // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+        	TRACE(cdaudio, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 			lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
@@ -955,7 +933,7 @@
 static DWORD CDAUDIO_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-    	dprintf_info(cdaudio,"CDAUDIO_mciSet(%04X, %08lX, %p);\n", 
+    	TRACE(cdaudio,"(%04X, %08lX, %p);\n", 
 		wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 /*
@@ -965,24 +943,22 @@
 	if (dwFlags & MCI_SET_TIME_FORMAT) {
 		switch (lpParms->dwTimeFormat) {
 			case MCI_FORMAT_MILLISECONDS:
-                		dprintf_info(cdaudio,
-				"CDAUDIO_mciSet // MCI_FORMAT_MILLISECONDS !\n");
+                		TRACE(cdaudio, "MCI_FORMAT_MILLISECONDS !\n");
 				break;
 			case MCI_FORMAT_MSF:
-                		dprintf_info(cdaudio,"CDAUDIO_mciSet // MCI_FORMAT_MSF !\n");
+                		TRACE(cdaudio,"MCI_FORMAT_MSF !\n");
 				break;
 			case MCI_FORMAT_TMSF:
-                		dprintf_info(cdaudio,"CDAUDIO_mciSet // MCI_FORMAT_TMSF !\n");
+                		TRACE(cdaudio,"MCI_FORMAT_TMSF !\n");
 				break;
 			default:
-                		dprintf_warn(cdaudio, "CDAUDIO_mciSet // bad time format !\n");
+                		WARN(cdaudio, "bad time format !\n");
 				return MCIERR_BAD_TIME_FORMAT;
 			}
 		CDADev[wDevID].dwTimeFormat = lpParms->dwTimeFormat;
 		}
 	if (dwFlags & MCI_SET_DOOR_OPEN) {
-        	dprintf_info(cdaudio,
-			"CDAUDIO_mciSet // MCI_SET_DOOR_OPEN !\n");
+        	TRACE(cdaudio, "MCI_SET_DOOR_OPEN !\n");
 #ifdef __FreeBSD__
 		if (ioctl(CDADev[wDevID].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE;
 		if (ioctl(CDADev[wDevID].unixdev, CDIOCEJECT)) return MCIERR_HARDWARE;
@@ -993,8 +969,7 @@
 		CDADev[wDevID].nTracks = 0;
 		}
 	if (dwFlags & MCI_SET_DOOR_CLOSED) {
-        	dprintf_info(cdaudio,
-			"CDAUDIO_mciSet // MCI_SET_DOOR_CLOSED !\n");
+        	TRACE(cdaudio, "MCI_SET_DOOR_CLOSED !\n");
 #ifdef __FreeBSD__
                 if (ioctl(CDADev[wDevID].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE;
                 if (ioctl(CDADev[wDevID].unixdev, CDIOCCLOSE)) return MCIERR_HARDWARE;
@@ -1009,8 +984,7 @@
 	if (dwFlags & MCI_SET_ON) return MCIERR_UNSUPPORTED_FUNCTION;
 	if (dwFlags & MCI_SET_OFF) return MCIERR_UNSUPPORTED_FUNCTION;
 	if (dwFlags & MCI_NOTIFY) {
-        	dprintf_info(cdaudio,
-			"CDAUDIO_mciSet // MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
+        	TRACE(cdaudio, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", 
 			lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
@@ -1084,8 +1058,7 @@
 			return CDAUDIO_mciSeek(dwDevID, dwParam1, 
 				(LPMCI_SEEK_PARMS)PTR_SEG_TO_LIN(dwParam2));
 		case MCI_SET_DOOR_OPEN:
-            		dprintf_info(cdaudio,
-				"CDAUDIO_DriverProc // MCI_SET_DOOR_OPEN !\n");
+            		TRACE(cdaudio, "MCI_SET_DOOR_OPEN !\n");
 #ifdef __FreeBSD__
 			if (ioctl(CDADev[dwDevID].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE;
 			if (ioctl(CDADev[dwDevID].unixdev, CDIOCEJECT)) return MCIERR_HARDWARE;
@@ -1096,7 +1069,7 @@
 			CDADev[dwDevID].nTracks = 0;
 			return 0;
 		case MCI_SET_DOOR_CLOSED:
-            		dprintf_info(cdaudio,"CDAUDIO_DriverProc // MCI_SET_DOOR_CLOSED !\n");
+            		TRACE(cdaudio,"MCI_SET_DOOR_CLOSED !\n");
 #ifdef __FreeBSD__
 			if (ioctl(CDADev[dwDevID].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE;
 			if (ioctl(CDADev[dwDevID].unixdev, CDIOCCLOSE)) return MCIERR_HARDWARE;
diff --git a/multimedia/mcistring.c b/multimedia/mcistring.c
index bdd2887..62f4cf7 100644
--- a/multimedia/mcistring.c
+++ b/multimedia/mcistring.c
@@ -65,10 +65,10 @@
  * for use in mciSendString()
  */
 #define _MCI_STR(s) do {\
-	dprintf_info(mci,"->returns \"%s\"",s);\
+	TRACE(mci,"->returns '%s'\n",s);\
 	if (lpstrReturnString) {\
 	    lstrcpyn32A(lpstrReturnString,s,uReturnLength);\
-	    dprintf_info(mci,"-->\"%s\"\n",lpstrReturnString);\
+	    TRACE(mci,"-->'%s'\n",lpstrReturnString);\
 	}\
 } while(0)
 
@@ -88,7 +88,7 @@
 		res=ANIM_DriverProc(GetDrv(wDevID)->modp.wDeviceID,0,cmd,dwFlags,(DWORD)(params));\
 		break;\
 	case MCI_DEVTYPE_DIGITAL_VIDEO:\
-		dprintf_fixme(mci,"_MCI_CALL_DRIVER //No DIGITAL_VIDEO yet !\n");\
+		FIXME(mci,"_MCI_CALL_DRIVER: No DIGITAL_VIDEO yet !\n");\
 		res=MCIERR_DEVICE_NOT_INSTALLED;\
 		break;\
 	default:\
@@ -335,7 +335,7 @@
 	while(GetDrv(wDevID)->modp.wType) {
 		wDevID = MMSYSTEM_NextDevID(wDevID);
 		if (!MMSYSTEM_DevIDValid(wDevID)) {
-			dprintf_info(mci, __FILE__":MCISTR_Open:MAXMCIDRIVERS reached (%x) !\n", wDevID);
+			TRACE(mci, "MAXMCIDRIVERS reached (%x) !\n", wDevID);
 			SEGPTR_FREE(PTR_SEG_TO_LIN(pU->openParams.lpstrElementName));
 			SEGPTR_FREE(pU);
 			return MCIERR_INTERNAL;
@@ -2112,7 +2112,7 @@
 	DWORD	dwFlags;
 	int	res=0,i,nrofkeywords;
 
-	dprintf_info(mci,"mciSendString('%s', %p, %d, %X)\n", lpstrCommand, 
+	TRACE(mci,"('%s', %p, %d, %X)\n", lpstrCommand, 
 		lpstrReturnString, uReturnLength, hwndCallback
 	);
 	/* format is <command> <device> <optargs> */
@@ -2182,7 +2182,7 @@
 				break;
 			wDevID = MMSYSTEM_NextDevID(wDevID);
 			if (!MMSYSTEM_DevIDValid(wDevID)) {
-				dprintf_info(mci, __FILE__":mciSendString:MAXMCIDRIVERS reached!\n");
+				TRACE(mci, "MAXMCIDRIVERS reached!\n");
 				free(keywords);free(cmd);
 				return MCIERR_INVALID_DEVICE_NAME;
 			}
diff --git a/multimedia/midi.c b/multimedia/midi.c
index 6a5b94a..f253d56 100644
--- a/multimedia/midi.c
+++ b/multimedia/midi.c
@@ -89,7 +89,7 @@
 static DWORD MIDI_NotifyClient(UINT16 wDevID, WORD wMsg, 
 				DWORD dwParam1, DWORD dwParam2)
 {
-	dprintf_info(midi,"MIDI_NotifyClient // wDevID = %04X wMsg = %d dwParm1 = %04lX dwParam2 = %04lX\n",wDevID, wMsg, dwParam1, dwParam2);
+	TRACE(midi,"wDevID = %04X wMsg = %d dwParm1 = %04lX dwParam2 = %04lX\n",wDevID, wMsg, dwParam1, dwParam2);
 
 #if defined(linux) || defined(__FreeBSD__)
 
@@ -107,7 +107,7 @@
 		MidiOutDev[wDevID].midiDesc.dwInstance, 
                 dwParam1, 
                 dwParam2)) {
-	    dprintf_warn(midi,"MIDI_NotifyClient // can't notify client !\n");
+	    WARN(midi,"can't notify client !\n");
 	    return MMSYSERR_NOERROR;
 	  }
 	  break;
@@ -120,7 +120,7 @@
 		MidiInDev[wDevID].midiDesc.dwCallback, MidiInDev[wDevID].wFlags, 
 		MidiInDev[wDevID].midiDesc.hMidi, wMsg, 
 		MidiInDev[wDevID].midiDesc.dwInstance, dwParam1, dwParam2)) {
-	    dprintf_warn(mciwave,"MIDI_NotifyClient // can't notify client !\n");
+	    WARN(mciwave,"can't notify client !\n");
 		return MMSYSERR_NOERROR;
 		}
 	  break;
@@ -144,7 +144,7 @@
 			return 0;
 		}
 	}
-	dprintf_warn(midi, "MIDI_ReadByte // error reading wDevID=%04X\n", wDevID);
+	WARN(midi, "error reading wDevID=%04X\n", wDevID);
 	return MCIERR_INTERNAL;
 
 #else
@@ -167,7 +167,7 @@
 			}
 		}
 	}
-	dprintf_warn(midi, "MIDI_ReadWord // error reading wDevID=%04X\n", wDevID);
+	WARN(midi, "error reading wDevID=%04X\n", wDevID);
 	return MCIERR_INTERNAL;
 }
 
@@ -186,7 +186,7 @@
 			}
 		}
 	}
-	dprintf_warn(midi, "MIDI_ReadLong // error reading wDevID=%04X\n", wDevID);
+	WARN(midi, "error reading wDevID=%04X\n", wDevID);
 	return MCIERR_INTERNAL;
 }
 
@@ -200,20 +200,20 @@
 	DWORD	value;
 	if (lpdw == NULL) return MCIERR_INTERNAL;
 	if (MIDI_ReadByte(wDevID, &byte) != 0) {
-		dprintf_warn(midi, "MIDI_ReadVaryLen // error reading wDevID=%04X\n", wDevID);
+		WARN(midi, "error reading wDevID=%04X\n", wDevID);
 		return MCIERR_INTERNAL;
 	}
 	value = (DWORD)(byte & 0x7F);
 	while (byte & 0x80) {
 		if (MIDI_ReadByte(wDevID, &byte) != 0) {
-			dprintf_warn(midi, "MIDI_ReadVaryLen // error reading wDevID=%04X\n", wDevID);
+			WARN(midi, "error reading wDevID=%04X\n", wDevID);
 			return MCIERR_INTERNAL;
 		}
 		value = (value << 7) + (byte & 0x7F);
 	}
 	*lpdw = value;
 /*
-	dprintf_info(midi, "MIDI_ReadVaryLen // val=%08lX \n", value);
+	TRACE(midi, "val=%08lX \n", value);
 */
 	return 0;
 }
@@ -227,9 +227,9 @@
 #if defined(linux) || defined(__FreeBSD__)
 	DWORD	toberead;
 	FOURCC	fourcc;
-	dprintf_info(midi, "MIDI_ReadMThd(%04X, %08lX);\n", wDevID, dwOffset);
+	TRACE(midi, "(%04X, %08lX);\n", wDevID, dwOffset);
 	if (mmioSeek(MCIMidiDev[wDevID].hFile, dwOffset, SEEK_SET) != dwOffset) {
-		dprintf_warn(midi, "MIDI_ReadMThd // can't seek at %08lX begin of 'MThd' \n", dwOffset);
+		WARN(midi, "can't seek at %08lX begin of 'MThd' \n", dwOffset);
 		return MCIERR_INTERNAL;
 	}
 	if (mmioRead(MCIMidiDev[wDevID].hFile, (HPSTR)&fourcc,
@@ -243,7 +243,7 @@
 		return MCIERR_INTERNAL;
 	if (MIDI_ReadWord(wDevID, &MCIMidiDev[wDevID].nTempo) != 0)
 		return MCIERR_INTERNAL;
-	dprintf_info(midi, "MIDI_ReadMThd // toberead=%08lX, wFormat=%04X nTracks=%04X nTempo=%04X\n",
+	TRACE(midi, "toberead=%08lX, wFormat=%04X nTracks=%04X nTempo=%04X\n",
 		toberead, MCIMidiDev[wDevID].wFormat,
 		MCIMidiDev[wDevID].nTracks,
 		MCIMidiDev[wDevID].nTempo);
@@ -265,7 +265,7 @@
 	DWORD	toberead;
 	FOURCC	fourcc;
 	if (mmioSeek(MCIMidiDev[wDevID].hFile, dwOffset, SEEK_SET) != dwOffset) {
-		dprintf_warn(midi, "MIDI_ReadMTrk // can't seek at %08lX begin of 'MThd' \n", dwOffset);
+		WARN(midi, "can't seek at %08lX begin of 'MThd' \n", dwOffset);
 		}
 	if (mmioRead(MCIMidiDev[wDevID].hFile, (HPSTR)&fourcc,
 		(long) sizeof(FOURCC)) != (long) sizeof(FOURCC)) {
@@ -274,7 +274,7 @@
 	if (MIDI_ReadLong(wDevID, &toberead) != 0) {
 		return MCIERR_INTERNAL;
 		}
-	dprintf_info(midi, "MIDI_ReadMTrk // toberead=%08lX\n", toberead);
+	TRACE(midi, "toberead=%08lX\n", toberead);
 	toberead -= 3 * sizeof(WORD);
 	MCIMidiDev[wDevID].dwTotalLen = toberead;
 	return 0;
@@ -296,7 +296,7 @@
 	LPSTR		lpstrElementName;
 	char		str[128];
 
-	dprintf_info(midi, "MIDI_mciOpen(%08lX, %p)\n", dwFlags, lpParms);
+	TRACE(midi, "(%08lX, %p)\n", dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 
 	if (MCIMidiDev[wDevID].nUseCount > 0) {
@@ -313,26 +313,26 @@
 		MCIMidiDev[wDevID].hMidiHdr = USER_HEAP_ALLOC(sizeof(MIDIHDR));
 	}
 
-	dprintf_info(midi, "MIDI_mciOpen // wDevID=%04X\n", wDevID);
+	TRACE(midi, "wDevID=%04X\n", wDevID);
 /*	lpParms->wDeviceID = wDevID;*/
-	dprintf_info(midi, "MIDI_mciOpen // lpParms->wDevID=%04X\n", lpParms->wDeviceID);
-	dprintf_info(midi, "MIDI_mciOpen // before OPEN_ELEMENT\n");
+	TRACE(midi, "lpParms->wDevID=%04X\n", lpParms->wDeviceID);
+	TRACE(midi, "before OPEN_ELEMENT\n");
 	if (dwFlags & MCI_OPEN_ELEMENT) {
 		lpstrElementName = (LPSTR)PTR_SEG_TO_LIN(lpParms->lpstrElementName);
-		dprintf_info(midi, "MIDI_mciOpen // MCI_OPEN_ELEMENT '%s' !\n", lpstrElementName);
+		TRACE(midi, "MCI_OPEN_ELEMENT '%s' !\n", lpstrElementName);
 		if (strlen(lpstrElementName) > 0) {
 			strcpy(str, lpstrElementName);
 			CharUpper32A(str);
 			MCIMidiDev[wDevID].hFile = mmioOpen16(str, NULL, 
 				MMIO_ALLOCBUF | MMIO_READWRITE | MMIO_EXCLUSIVE);
 			if (MCIMidiDev[wDevID].hFile == 0) {
-				dprintf_warn(midi, "MIDI_mciOpen // can't find file='%s' !\n", str);
+				WARN(midi, "can't find file='%s' !\n", str);
 				return MCIERR_FILE_NOT_FOUND;
 			}
 		} else 
 			MCIMidiDev[wDevID].hFile = 0;
 	}
-	dprintf_info(midi, "MIDI_mciOpen // hFile=%u\n", MCIMidiDev[wDevID].hFile);
+	TRACE(midi, "hFile=%u\n", MCIMidiDev[wDevID].hFile);
 	memcpy(&MCIMidiDev[wDevID].openParms, lpParms, sizeof(MCI_OPEN_PARMS16));
 	MCIMidiDev[wDevID].wNotifyDeviceID = lpParms->wDeviceID;
 	MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP;
@@ -344,30 +344,30 @@
 		if (mmioDescend(MCIMidiDev[wDevID].hFile, &ckMainRIFF, NULL, 0) != 0) {
 			return MCIERR_INTERNAL;
 		}
-		dprintf_info(midi,"MIDI_mciOpen // ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n",
+		TRACE(midi,"ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n",
 				(LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType,
 				ckMainRIFF.cksize);
 		dwOffset = 0;
 		if (ckMainRIFF.ckid == mmioFOURCC('R', 'M', 'I', 'D')) {
-			dprintf_info(midi, "MIDI_mciOpen // is a 'RMID' file \n");
+			TRACE(midi, "is a 'RMID' file \n");
 			dwOffset = ckMainRIFF.dwDataOffset;
 		}
 		if (ckMainRIFF.ckid != mmioFOURCC('M', 'T', 'h', 'd')) {
-			dprintf_warn(midi, "MIDI_mciOpen // unknown format !\n");
+			WARN(midi, "unknown format !\n");
 			return MCIERR_INTERNAL;
 		}
 		if (MIDI_ReadMThd(wDevID, dwOffset) != 0) {
-			dprintf_warn(midi, "MIDI_mciOpen // can't read 'MThd' header \n");
+			WARN(midi, "can't read 'MThd' header \n");
 			return MCIERR_INTERNAL;
 		}
 		dwOffset = mmioSeek(MCIMidiDev[wDevID].hFile, 0, SEEK_CUR);
 		if (MIDI_ReadMTrk(wDevID, dwOffset) != 0) {
-			dprintf_warn(midi, "MIDI_mciOpen // can't read 'MTrk' header \n");
+			WARN(midi, "can't read 'MTrk' header \n");
 			return MCIERR_INTERNAL;
 		}
 		dwOffset = mmioSeek(MCIMidiDev[wDevID].hFile, 0, SEEK_CUR);
 		MCIMidiDev[wDevID].dwBeginData = dwOffset;
-		dprintf_info(midi, "MIDI_mciOpen // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
+		TRACE(midi, "Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
 				(LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType,
 				ckMainRIFF.cksize);
 	}
@@ -387,10 +387,10 @@
 static DWORD MIDI_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(midi, "MIDI_mciStop(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(midi, "(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP;
-	dprintf_info(midi, "MIDI_mciStop // MCIMidiDev[wDevID].dwStatus=%p %d\n",
+	TRACE(midi, "MCIMidiDev[wDevID].dwStatus=%p %d\n",
 			&MCIMidiDev[wDevID].dwStatus, MCIMidiDev[wDevID].dwStatus);
 	return 0;
 #else
@@ -407,7 +407,7 @@
 #if defined(linux) || defined(__FreeBSD__)
 	DWORD		dwRet;
 
-	dprintf_info(midi, "MIDI_mciClose(%04X, %08lX, %p);\n", wDevID, dwParam, lpParms);
+	TRACE(midi, "(%04X, %08lX, %p);\n", wDevID, dwParam, lpParms);
 	if (MCIMidiDev[wDevID].dwStatus != MCI_MODE_STOP) {
 		MIDI_mciStop(wDevID, MCI_WAIT, lpParms);
 		}
@@ -417,7 +417,7 @@
 		if (MCIMidiDev[wDevID].hFile != 0) {
 			mmioClose(MCIMidiDev[wDevID].hFile, 0);
 			MCIMidiDev[wDevID].hFile = 0;
-			dprintf_info(midi, "MIDI_mciClose // hFile closed !\n");
+			TRACE(midi, "hFile closed !\n");
 			}
 		USER_HEAP_FREE(MCIMidiDev[wDevID].hMidiHdr);
 		dwRet = modMessage(wDevID, MODM_CLOSE, 0, 0L, 0L);
@@ -445,33 +445,33 @@
 	DWORD		dwData,dwRet;
 	LPWORD		ptr;
 
-	dprintf_info(midi, "MIDI_mciPlay(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(midi, "(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (MCIMidiDev[wDevID].hFile == 0) {
-		dprintf_warn(midi, "MIDI_mciPlay // can't find file='%08lx' !\n", 
+		WARN(midi, "can't find file='%08lx' !\n", 
 				(DWORD)MCIMidiDev[wDevID].openParms.lpstrElementName);
 		return MCIERR_FILE_NOT_FOUND;
 	}
 	start = 1; 		end = 99999;
 	if (dwFlags & MCI_FROM) {
 		start = lpParms->dwFrom; 
-		dprintf_info(midi, "MIDI_mciPlay // MCI_FROM=%d \n", start);
+		TRACE(midi, "MCI_FROM=%d \n", start);
 	}
 	if (dwFlags & MCI_TO) {
 		end = lpParms->dwTo;
-		dprintf_info(midi, "MIDI_mciPlay // MCI_TO=%d \n", end);
+		TRACE(midi, "MCI_TO=%d \n", end);
 	}
 #if 0
 	if (dwFlags & MCI_NOTIFY) {
-		dprintf_info(midi, "MIDI_mciPlay // MCI_NOTIFY %08lX !\n", lpParms->dwCallback);
+		TRACE(midi, "MCI_NOTIFY %08lX !\n", lpParms->dwCallback);
 		switch(fork()) {
 		case -1:
-			dprintf_warn(midi, "MIDI_mciPlay // Can't 'fork' process !\n");
+			WARN(midi, "Can't 'fork' process !\n");
 			break;
 		case 0:
-			dprintf_info(midi, "MIDI_mciPlay // process started ! play in background ...\n");
+			TRACE(midi, "process started ! play in background ...\n");
 			break;
 		default:
-			dprintf_info(midi, "MIDI_mciPlay // process started ! return to caller...\n");
+			TRACE(midi, "process started ! return to caller...\n");
 			return 0;
 		}
 	}
@@ -486,11 +486,11 @@
 	lpMidiHdr->dwFlags = 0L;
 	dwRet = modMessage(wDevID, MODM_PREPARE, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR));
 
-/*	dprintf_info(midi, "MIDI_mciPlay // after MODM_PREPARE \n"); */
+/*	TRACE(midi, "after MODM_PREPARE \n"); */
 
 	MCIMidiDev[wDevID].dwStatus = MCI_MODE_PLAY;
 	while(MCIMidiDev[wDevID].dwStatus != MCI_MODE_STOP) {
-		dprintf_info(midi, "MIDI_mciPlay // MCIMidiDev[wDevID].dwStatus=%p %d\n",
+		TRACE(midi, "MCIMidiDev[wDevID].dwStatus=%p %d\n",
 			&MCIMidiDev[wDevID].dwStatus, MCIMidiDev[wDevID].dwStatus);
 
 		ptr = (LPWORD)lpMidiHdr->lpData;
@@ -501,11 +501,11 @@
 /*
 		count = mmioRead(MCIMidiDev[wDevID].hFile, lpMidiHdr->lpData, lpMidiHdr->dwBufferLength);
 */
-		dprintf_info(midi, "MIDI_mciPlay // after read count = %d\n",count);
+		TRACE(midi, "after read count = %d\n",count);
 
 		if (count < 1) break;
 		lpMidiHdr->dwBytesRecorded = count;
-		dprintf_info(midi, "MIDI_mciPlay // before MODM_LONGDATA lpMidiHdr=%p dwBytesRecorded=%lu\n",
+		TRACE(midi, "before MODM_LONGDATA lpMidiHdr=%p dwBytesRecorded=%lu\n",
 					lpMidiHdr, lpMidiHdr->dwBytesRecorded);
 		dwRet = modMessage(wDevID, MODM_LONGDATA, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR));
 		if (dwRet != MMSYSERR_NOERROR) {
@@ -537,7 +537,7 @@
 	}
 	MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP;
 	if (dwFlags & MCI_NOTIFY) {
-		dprintf_info(midi, "MIDI_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
+		TRACE(midi, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			MCIMidiDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
 #if 0
@@ -561,20 +561,20 @@
 	LPMIDIHDR	lpMidiHdr;
 	DWORD		dwRet;
 
-	dprintf_info(midi, "MIDI_mciRecord(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(midi, "(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (MCIMidiDev[wDevID].hFile == 0) {
-		dprintf_warn(midi, "MIDI_mciRecord // can't find file='%08lx' !\n", 
+		WARN(midi, "can't find file='%08lx' !\n", 
 			(DWORD)MCIMidiDev[wDevID].openParms.lpstrElementName);
 		return MCIERR_FILE_NOT_FOUND;
 	}
 	start = 1; 		end = 99999;
 	if (dwFlags & MCI_FROM) {
 		start = lpParms->dwFrom; 
-		dprintf_info(midi, "MIDI_mciRecord // MCI_FROM=%d \n", start);
+		TRACE(midi, "MCI_FROM=%d \n", start);
 	}
 	if (dwFlags & MCI_TO) {
 		end = lpParms->dwTo;
-		dprintf_info(midi, "MIDI_mciRecord // MCI_TO=%d \n", end);
+		TRACE(midi, "MCI_TO=%d \n", end);
 	}
 	lpMidiHdr = USER_HEAP_LIN_ADDR(MCIMidiDev[wDevID].hMidiHdr);
 	lpMidiHdr->lpData = (LPSTR) xmalloc(1200);
@@ -582,27 +582,27 @@
 	lpMidiHdr->dwUser = 0L;
 	lpMidiHdr->dwFlags = 0L;
 	dwRet = midMessage(wDevID, MIDM_PREPARE, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR));
-	dprintf_info(midi, "MIDI_mciRecord // after MIDM_PREPARE \n");
+	TRACE(midi, "after MIDM_PREPARE \n");
 	MCIMidiDev[wDevID].dwStatus = MCI_MODE_RECORD;
 	while(MCIMidiDev[wDevID].dwStatus != MCI_MODE_STOP) {
-		dprintf_info(midi, "MIDI_mciRecord // MCIMidiDev[wDevID].dwStatus=%p %d\n",
+		TRACE(midi, "MCIMidiDev[wDevID].dwStatus=%p %d\n",
 			&MCIMidiDev[wDevID].dwStatus, MCIMidiDev[wDevID].dwStatus);
 		lpMidiHdr->dwBytesRecorded = 0;
 		dwRet = midMessage(wDevID, MIDM_START, 0, 0L, 0L);
-		dprintf_info(midi, "MIDI_mciRecord // after MIDM_START lpMidiHdr=%p dwBytesRecorded=%lu\n",
+		TRACE(midi, "after MIDM_START lpMidiHdr=%p dwBytesRecorded=%lu\n",
 					lpMidiHdr, lpMidiHdr->dwBytesRecorded);
 		if (lpMidiHdr->dwBytesRecorded == 0) break;
 	}
-	dprintf_info(midi, "MIDI_mciRecord // before MIDM_UNPREPARE \n");
+	TRACE(midi, "before MIDM_UNPREPARE \n");
 	dwRet = midMessage(wDevID, MIDM_UNPREPARE, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR));
-	dprintf_info(midi, "MIDI_mciRecord // after MIDM_UNPREPARE \n");
+	TRACE(midi, "after MIDM_UNPREPARE \n");
 	if (lpMidiHdr->lpData != NULL) {
 		free(lpMidiHdr->lpData);
 		lpMidiHdr->lpData = NULL;
 	}
 	MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP;
 	if (dwFlags & MCI_NOTIFY) {
-		dprintf_info(midi, "MIDI_mciRecord // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
+		TRACE(midi, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			MCIMidiDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
 	}
@@ -619,7 +619,7 @@
 static DWORD MIDI_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(midi, "MIDI_mciPause(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(midi, "(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	return 0;
 #else
@@ -634,7 +634,7 @@
 static DWORD MIDI_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(midi, "MIDI_mciResume(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(midi, "(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	return 0;
 #else
@@ -649,23 +649,23 @@
 static DWORD MIDI_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(midi, "MIDI_mciSet(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(midi, "(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
-	dprintf_info(midi, "MIDI_mciSet // dwTimeFormat=%08lX\n", lpParms->dwTimeFormat);
-	dprintf_info(midi, "MIDI_mciSet // dwAudio=%08lX\n", lpParms->dwAudio);
+	TRACE(midi, "dwTimeFormat=%08lX\n", lpParms->dwTimeFormat);
+	TRACE(midi, "dwAudio=%08lX\n", lpParms->dwAudio);
 	if (dwFlags & MCI_SET_TIME_FORMAT) {
 		switch (lpParms->dwTimeFormat) {
 		case MCI_FORMAT_MILLISECONDS:
-			dprintf_info(midi, "MIDI_mciSet // MCI_FORMAT_MILLISECONDS !\n");
+			TRACE(midi, "MCI_FORMAT_MILLISECONDS !\n");
 			break;
 		case MCI_FORMAT_BYTES:
-			dprintf_info(midi, "MIDI_mciSet // MCI_FORMAT_BYTES !\n");
+			TRACE(midi, "MCI_FORMAT_BYTES !\n");
 			break;
 		case MCI_FORMAT_SAMPLES:
-			dprintf_info(midi, "MIDI_mciSet // MCI_FORMAT_SAMPLES !\n");
+			TRACE(midi, "MCI_FORMAT_SAMPLES !\n");
 			break;
 		default:
-			dprintf_warn(midi, "MIDI_mciSet // bad time format !\n");
+			WARN(midi, "bad time format !\n");
 			return MCIERR_BAD_TIME_FORMAT;
 		}
 	}
@@ -673,26 +673,26 @@
 	if (dwFlags & MCI_SET_DOOR_OPEN) return MCIERR_UNSUPPORTED_FUNCTION;
 	if (dwFlags & MCI_SET_DOOR_CLOSED) return MCIERR_UNSUPPORTED_FUNCTION;
 	if (dwFlags & MCI_SET_AUDIO)
-		dprintf_info(midi, "MIDI_mciSet // MCI_SET_AUDIO !\n");
+		TRACE(midi, "MCI_SET_AUDIO !\n");
 	if (dwFlags && MCI_SET_ON) {
-		dprintf_info(midi, "MIDI_mciSet // MCI_SET_ON !\n");
+		TRACE(midi, "MCI_SET_ON !\n");
 		if (dwFlags && MCI_SET_AUDIO_LEFT)
-			dprintf_info(midi, "MIDI_mciSet // MCI_SET_AUDIO_LEFT !\n");
+			TRACE(midi, "MCI_SET_AUDIO_LEFT !\n");
 		if (dwFlags && MCI_SET_AUDIO_RIGHT)
-			dprintf_info(midi, "MIDI_mciSet // MCI_SET_AUDIO_RIGHT !\n");
+			TRACE(midi, "MCI_SET_AUDIO_RIGHT !\n");
 	}
 	if (dwFlags & MCI_SET_OFF)
-		dprintf_info(midi, "MIDI_mciSet // MCI_SET_OFF !\n");
+		TRACE(midi, "MCI_SET_OFF !\n");
 	if (dwFlags & MCI_SEQ_SET_MASTER)
-		dprintf_info(midi, "MIDI_mciSet // MCI_SEQ_SET_MASTER !\n");
+		TRACE(midi, "MCI_SEQ_SET_MASTER !\n");
 	if (dwFlags & MCI_SEQ_SET_SLAVE)
-		dprintf_info(midi, "MIDI_mciSet // MCI_SEQ_SET_SLAVE !\n");
+		TRACE(midi, "MCI_SEQ_SET_SLAVE !\n");
 	if (dwFlags & MCI_SEQ_SET_OFFSET)
-		dprintf_info(midi, "MIDI_mciSet // MCI_SEQ_SET_OFFSET !\n");
+		TRACE(midi, "MCI_SEQ_SET_OFFSET !\n");
 	if (dwFlags & MCI_SEQ_SET_PORT)
-		dprintf_info(midi, "MIDI_mciSet // MCI_SEQ_SET_PORT !\n");
+		TRACE(midi, "MCI_SEQ_SET_PORT !\n");
 	if (dwFlags & MCI_SEQ_SET_TEMPO)
-		dprintf_info(midi, "MIDI_mciSet // MCI_SEQ_SET_TEMPO !\n");
+		TRACE(midi, "MCI_SEQ_SET_TEMPO !\n");
  	return 0;
 #else
 	return MCIERR_INTERNAL;
@@ -706,7 +706,7 @@
 static DWORD MIDI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(midi, "MIDI_mciStatus(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(midi, "(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (dwFlags & MCI_STATUS_ITEM) {
 		switch(lpParms->dwItem) {
@@ -724,7 +724,7 @@
 			lpParms->dwReturn = MCI_MODE_STOP;
 			break;
 		case MCI_STATUS_MEDIA_PRESENT:
-			dprintf_info(midi, "MIDI_mciStatus // MCI_STATUS_MEDIA_PRESENT !\n");
+			TRACE(midi, "MCI_STATUS_MEDIA_PRESENT !\n");
 			lpParms->dwReturn = TRUE;
 			break;
 		case MCI_STATUS_NUMBER_OF_TRACKS:
@@ -740,44 +740,44 @@
 			}
 			break;
 		case MCI_STATUS_READY:
-			dprintf_info(midi, "MIDI_mciStatus // MCI_STATUS_READY !\n");
+			TRACE(midi, "MCI_STATUS_READY !\n");
 			lpParms->dwReturn = TRUE;
 			break;
 		case MCI_STATUS_TIME_FORMAT:
-			dprintf_info(midi, "MIDI_mciStatus // MCI_STATUS_TIME_FORMAT !\n");
+			TRACE(midi, "MCI_STATUS_TIME_FORMAT !\n");
 			lpParms->dwReturn = MCI_FORMAT_MILLISECONDS;
 			break;
 		case MCI_SEQ_STATUS_DIVTYPE:
-			dprintf_info(midi, "MIDI_mciStatus // MCI_SEQ_STATUS_DIVTYPE !\n");
+			TRACE(midi, "MCI_SEQ_STATUS_DIVTYPE !\n");
 			lpParms->dwReturn = 0;
 			break;
 		case MCI_SEQ_STATUS_MASTER:
-			dprintf_info(midi, "MIDI_mciStatus // MCI_SEQ_STATUS_MASTER !\n");
+			TRACE(midi, "MCI_SEQ_STATUS_MASTER !\n");
 			lpParms->dwReturn = 0;
 			break;
 		case MCI_SEQ_STATUS_SLAVE:
-			dprintf_info(midi, "MIDI_mciStatus // MCI_SEQ_STATUS_SLAVE !\n");
+			TRACE(midi, "MCI_SEQ_STATUS_SLAVE !\n");
 			lpParms->dwReturn = 0;
 			break;
 		case MCI_SEQ_STATUS_OFFSET:
-			dprintf_info(midi, "MIDI_mciStatus // MCI_SEQ_STATUS_OFFSET !\n");
+			TRACE(midi, "MCI_SEQ_STATUS_OFFSET !\n");
 			lpParms->dwReturn = 0;
 			break;
 		case MCI_SEQ_STATUS_PORT:
-			dprintf_info(midi, "MIDI_mciStatus // MCI_SEQ_STATUS_PORT !\n");
+			TRACE(midi, "MCI_SEQ_STATUS_PORT !\n");
 			lpParms->dwReturn = 0;
 			break;
 		case MCI_SEQ_STATUS_TEMPO:
-			dprintf_info(midi, "MIDI_mciStatus // MCI_SEQ_STATUS_TEMPO !\n");
+			TRACE(midi, "MCI_SEQ_STATUS_TEMPO !\n");
 			lpParms->dwReturn = 0;
 			break;
 		default:
-			dprintf_warn(midi, "MIDI_mciStatus // unknowm command %08lX !\n", lpParms->dwItem);
+			WARN(midi, "unknowm command %08lX !\n", lpParms->dwItem);
 			return MCIERR_UNRECOGNIZED_COMMAND;
 		}
 	}
 	if (dwFlags & MCI_NOTIFY) {
-		dprintf_info(midi, "MIDI_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
+		TRACE(midi, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
 		mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), 
 			MCIMidiDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
 	}
@@ -794,7 +794,7 @@
 					LPMCI_GETDEVCAPS_PARMS lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(midi, "MIDI_mciGetDevCaps(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(midi, "(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (dwFlags & MCI_GETDEVCAPS_ITEM) {
 		switch(lpParms->dwItem) {
@@ -841,7 +841,7 @@
 static DWORD MIDI_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpParms)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(midi, "MIDI_mciInfo(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
+	TRACE(midi, "(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	lpParms->lpstrReturn = NULL;
 	switch(dwFlags) {
@@ -873,7 +873,7 @@
  */
 static DWORD midGetDevCaps(WORD wDevID, LPMIDIINCAPS16 lpCaps, DWORD dwSize)
 {
-	dprintf_info(midi, "midGetDevCaps(%04X, %p, %08lX);\n", wDevID, lpCaps, dwSize);
+	TRACE(midi, "(%04X, %p, %08lX);\n", wDevID, lpCaps, dwSize);
 	lpCaps->wMid = 0x00FF; 	        /* Manufac ID */
 	lpCaps->wPid = 0x0001; 	        /* Product ID */
 	lpCaps->vDriverVersion = 0x001; /* Product Version */
@@ -889,38 +889,34 @@
 {
 #if defined(linux) || defined(__FreeBSD__)
 	int		midi;
-	dprintf_info(midi,
-		"midOpen(%04X, %p, %08lX);\n", wDevID, lpDesc, dwFlags);
+	TRACE(midi, "(%04X, %p, %08lX);\n", wDevID, lpDesc, dwFlags);
 	if (lpDesc == NULL) {
-		dprintf_warn(midi, "Linux 'midOpen' // Invalid Parameter !\n");
+		WARN(midi, "Invalid Parameter !\n");
 		return MMSYSERR_INVALPARAM;
 	}
 	if (wDevID >= MAX_MIDIINDRV) {
-		dprintf_info(midi,"Linux 'midOpen' // MAX_MIDIINDRV reached !\n");
+		TRACE(midi,"MAX_MIDIINDRV reached !\n");
 		return MMSYSERR_ALLOCATED;
 	}
 	MidiInDev[wDevID].unixdev = 0;
 	midi = open (MIDI_DEV, O_RDONLY, 0);
 	if (midi == -1) {
-		dprintf_warn(midi,"Linux 'midOpen' // can't open !\n");
+		WARN(midi,"can't open !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	MidiInDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK);
 	switch(MidiInDev[wDevID].wFlags) {
 		case DCB_NULL:
-			dprintf_info(midi,"Linux 'midOpen' // CALLBACK_NULL !\n");
+			TRACE(midi,"CALLBACK_NULL !\n");
 			break;
 		case DCB_WINDOW:
-			dprintf_info(midi,
-				"Linux 'midOpen' // CALLBACK_WINDOW !\n");
+			TRACE(midi, "CALLBACK_WINDOW !\n");
 			break;
 		case DCB_TASK:
-			dprintf_info(midi,
-				   "Linux 'midOpen' // CALLBACK_TASK !\n");
+			TRACE(midi, "CALLBACK_TASK !\n");
 			break;
 		case DCB_FUNCTION:
-			dprintf_info(midi,
-				   "Linux 'midOpen' // CALLBACK_FUNCTION !\n");
+			TRACE(midi, "CALLBACK_FUNCTION !\n");
 			break;
 	}
 	MidiInDev[wDevID].lpQueueHdr = NULL;
@@ -928,7 +924,7 @@
 	MidiInDev[wDevID].dwTotalPlayed = 0;
 	MidiInDev[wDevID].bufsize = 0x3FFF;
 	if (MIDI_NotifyClient(wDevID, MIM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) {
-		dprintf_warn(midi,"Linux 'midOpen' // can't notify client !\n");
+		WARN(midi,"can't notify client !\n");
 		return MMSYSERR_INVALPARAM;
 	}
 	return MMSYSERR_NOERROR;
@@ -943,16 +939,16 @@
 static DWORD midClose(WORD wDevID)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(midi, "midClose(%04X);\n", wDevID);
+	TRACE(midi, "(%04X);\n", wDevID);
 	if (MidiInDev[wDevID].unixdev == 0) {
-		dprintf_warn(midi,"Linux 'midClose' // can't close !\n");
+		WARN(midi,"can't close !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	close(MidiInDev[wDevID].unixdev);
 	MidiInDev[wDevID].unixdev = 0;
 	MidiInDev[wDevID].bufsize = 0;
 	if (MIDI_NotifyClient(wDevID, MIM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) {
-		dprintf_warn(midi,"Linux 'midClose' // can't notify client !\n");
+		WARN(midi,"can't notify client !\n");
 		return MMSYSERR_INVALPARAM;
 	}
 	return MMSYSERR_NOERROR;
@@ -966,7 +962,7 @@
  */
 static DWORD midAddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
 {
-	dprintf_info(midi, "midAddBuffer(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
+	TRACE(midi, "(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
 	return MMSYSERR_NOTENABLED;
 }
 
@@ -975,7 +971,7 @@
  */
 static DWORD midPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
 {
-	dprintf_info(midi, "midPrepare(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
+	TRACE(midi, "(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
 	return MMSYSERR_NOTENABLED;
 }
 
@@ -984,7 +980,7 @@
  */
 static DWORD midUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
 {
-	dprintf_info(midi, "midUnprepare(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
+	TRACE(midi, "(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
 	return MMSYSERR_NOTENABLED;
 }
 
@@ -993,7 +989,7 @@
  */
 static DWORD midReset(WORD wDevID)
 {
-	dprintf_info(midi, "midReset(%04X);\n", wDevID);
+	TRACE(midi, "(%04X);\n", wDevID);
 	return MMSYSERR_NOTENABLED;
 }
 
@@ -1003,7 +999,7 @@
  */
 static DWORD midStart(WORD wDevID)
 {
-	dprintf_info(midi, "midStart(%04X);\n", wDevID);
+	TRACE(midi, "(%04X);\n", wDevID);
 	return MMSYSERR_NOTENABLED;
 }
 
@@ -1013,7 +1009,7 @@
  */
 static DWORD midStop(WORD wDevID)
 {
-	dprintf_info(midi, "midStop(%04X);\n", wDevID);
+	TRACE(midi, "(%04X);\n", wDevID);
 	return MMSYSERR_NOTENABLED;
 }
 
@@ -1024,7 +1020,7 @@
 DWORD midMessage(WORD wDevID, WORD wMsg, DWORD dwUser, 
 					DWORD dwParam1, DWORD dwParam2)
 {
-	dprintf_info(midi, "midMessage(%04X, %04X, %08lX, %08lX, %08lX);\n", 
+	TRACE(midi, "(%04X, %04X, %08lX, %08lX, %08lX);\n", 
 			wDevID, wMsg, dwUser, dwParam1, dwParam2);
 	switch(wMsg) {
 	case MIDM_OPEN:
@@ -1061,7 +1057,7 @@
  */
 static DWORD modGetDevCaps(WORD wDevID, LPMIDIOUTCAPS16 lpCaps, DWORD dwSize)
 {
-	dprintf_info(midi, "modGetDevCaps(%04X, %p, %08lX);\n", wDevID, lpCaps, dwSize);
+	TRACE(midi, "(%04X, %p, %08lX);\n", wDevID, lpCaps, dwSize);
 	lpCaps->wMid = 0x00FF; 	/* Manufac ID */
 	lpCaps->wPid = 0x0001; 	/* Product ID */
 	lpCaps->vDriverVersion = 0x001; /* Product Version */
@@ -1074,7 +1070,7 @@
 	lpCaps->wVoices     = 14;       /* make it ioctl */
 	lpCaps->wNotes      = 14;       /* make it ioctl */
 	lpCaps->dwSupport   = MIDICAPS_VOLUME|MIDICAPS_LRVOLUME;
-	dprintf_info(midi,"Linux modGetDevCaps // techn = %d voices=%d notes = %d support = %ld\n",lpCaps->wTechnology,lpCaps->wVoices,lpCaps->wNotes,lpCaps->dwSupport);
+	TRACE(midi,"techn = %d voices=%d notes = %d support = %ld\n",lpCaps->wTechnology,lpCaps->wVoices,lpCaps->wNotes,lpCaps->dwSupport);
 
 	return MMSYSERR_NOERROR;
 }
@@ -1088,38 +1084,34 @@
 #if defined(linux) || defined(__FreeBSD__)
 	int		midi;
 
-	dprintf_info(midi,
-		"modOpen(%04X, %p, %08lX);\n", wDevID, lpDesc, dwFlags);
+	TRACE(midi, "(%04X, %p, %08lX);\n", wDevID, lpDesc, dwFlags);
 	if (lpDesc == NULL) {
-		dprintf_warn(midi, "Linux 'modOpen' // Invalid Parameter !\n");
+		WARN(midi, "Invalid Parameter !\n");
 		return MMSYSERR_INVALPARAM;
 	}
 	if (wDevID>= MAX_MIDIOUTDRV) {
-		dprintf_info(midi,"Linux 'modOpen' // MAX_MIDIOUTDRV reached !\n");
+		TRACE(midi,"MAX_MIDIOUTDRV reached !\n");
 		return MMSYSERR_ALLOCATED;
 	}
 	MidiOutDev[wDevID].unixdev = 0;
 	midi = open (MIDI_DEV, O_WRONLY, 0);
 	if (midi == -1) {
-		dprintf_warn(midi,"Linux 'modOpen' // can't open !\n");
+		WARN(midi, "can't open !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	MidiOutDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK);
 	switch(MidiOutDev[wDevID].wFlags) {
 	case DCB_NULL:
-		dprintf_info(midi,"Linux 'modOpen' // CALLBACK_NULL !\n");
+		TRACE(midi,"CALLBACK_NULL !\n");
 		break;
 	case DCB_WINDOW:
-		dprintf_info(midi,
-			"Linux 'modOpen' // CALLBACK_WINDOW !\n");
+		TRACE(midi, "CALLBACK_WINDOW !\n");
 		break;
 	case DCB_TASK:
-		dprintf_info(midi,
-			"Linux 'modOpen' // CALLBACK_TASK !\n");
+		TRACE(midi, "CALLBACK_TASK !\n");
 		break;
 	case DCB_FUNCTION:
-		dprintf_info(midi,
-			"Linux 'modOpen' // CALLBACK_FUNCTION !\n");
+		TRACE(midi, "CALLBACK_FUNCTION !\n");
 		break;
 	}
 	MidiOutDev[wDevID].lpQueueHdr = NULL;
@@ -1127,11 +1119,10 @@
 	MidiOutDev[wDevID].dwTotalPlayed = 0;
 	MidiOutDev[wDevID].bufsize = 0x3FFF;
 	if (MIDI_NotifyClient(wDevID, MOM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) {
-		dprintf_warn(midi,"Linux 'modOpen' // can't notify client !\n");
+		WARN(midi,"can't notify client !\n");
 		return MMSYSERR_INVALPARAM;
 	}
-	dprintf_info(midi,
-		"Linux 'modOpen' // Succesful unixdev=%d !\n", midi);
+	TRACE(midi, "Succesful unixdev=%d !\n", midi);
 	return MMSYSERR_NOERROR;
 #else
 	return MMSYSERR_NOTENABLED;
@@ -1145,16 +1136,16 @@
 static DWORD modClose(WORD wDevID)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(midi, "modClose(%04X);\n", wDevID);
+	TRACE(midi, "(%04X);\n", wDevID);
 	if (MidiOutDev[wDevID].unixdev == 0) {
-		dprintf_warn(midi,"Linux 'modClose' // can't close !\n");
+		WARN(midi,"can't close !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	close(MidiOutDev[wDevID].unixdev);
 	MidiOutDev[wDevID].unixdev = 0;
 	MidiOutDev[wDevID].bufsize = 0;
 	if (MIDI_NotifyClient(wDevID, MOM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) {
-		dprintf_warn(midi,"Linux 'modClose' // can't notify client !\n");
+		WARN(midi,"can't notify client !\n");
 		return MMSYSERR_INVALPARAM;
 	}
 	return MMSYSERR_NOERROR;
@@ -1171,16 +1162,15 @@
 #if defined(linux) || defined(__FreeBSD__)
 	WORD	event;
 
-	dprintf_info(midi,	
-		"modData(%04X, %08lX);\n", wDevID, dwParam);
+	TRACE(midi, "(%04X, %08lX);\n", wDevID, dwParam);
 	if (MidiOutDev[wDevID].unixdev == 0) {
-        	dprintf_warn(midi,"Linux 'modData' // can't play !\n");
+        	WARN(midi,"can't play !\n");
 		return MIDIERR_NODEVICE;
 	}
 	event = LOWORD(dwParam);
 	if (write (MidiOutDev[wDevID].unixdev, 
 		&event, sizeof(WORD)) != sizeof(WORD)) {
-		dprintf_warn(midi, "modData() // error writting unixdev !\n");
+		WARN(midi, "error writting unixdev !\n");
 	}
 	return MMSYSERR_NOTENABLED;
 #else
@@ -1198,10 +1188,9 @@
 	LPWORD	ptr;
 	int     en;
 
-	dprintf_info(midi,	
-		"modLongData(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
+	TRACE(midi, "(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
 	if (MidiOutDev[wDevID].unixdev == 0) {
-        dprintf_warn(midi,"Linux 'modLongData' // can't play !\n");
+        WARN(midi,"can't play !\n");
 		return MIDIERR_NODEVICE;
 		}
 	if (lpMidiHdr->lpData == NULL) return MIDIERR_UNPREPARED;
@@ -1209,13 +1198,10 @@
 	if (lpMidiHdr->dwFlags & MHDR_INQUEUE) return MIDIERR_STILLPLAYING;
 	lpMidiHdr->dwFlags &= ~MHDR_DONE;
 	lpMidiHdr->dwFlags |= MHDR_INQUEUE;
-	dprintf_info(midi,
-		"modLongData() // dwBytesRecorded %lu !\n", lpMidiHdr->dwBytesRecorded);
-	dprintf_info(midi,
-                "                 %02X %02X %02X %02X\n",lpMidiHdr->lpData[0],
-                                                         lpMidiHdr->lpData[1],
-		                                         lpMidiHdr->lpData[2],
-		                                         lpMidiHdr->lpData[3]);
+	TRACE(midi, "dwBytesRecorded %lu !\n", lpMidiHdr->dwBytesRecorded);
+	TRACE(midi, "                 %02X %02X %02X %02X\n",
+		     lpMidiHdr->lpData[0], lpMidiHdr->lpData[1],
+		     lpMidiHdr->lpData[2], lpMidiHdr->lpData[3]);
 /*
 	count = write (MidiOutDev[wDevID].unixdev, 
 		lpMidiHdr->lpData, lpMidiHdr->dwBytesRecorded);
@@ -1228,19 +1214,18 @@
 	}
 
 	en = errno;
-	dprintf_info(midi, "Linux 'modLongData' // after write count = %d\n",count);
+	TRACE(midi, "after write count = %d\n",count);
 	if (count != lpMidiHdr->dwBytesRecorded) {
-		dprintf_warn(midi,
-		       "modLongData() // error writting unixdev #%d ! (%d != %ld)\n",
-			MidiOutDev[wDevID].unixdev, count, lpMidiHdr->dwBytesRecorded);
-		dprintf_info(midi,
-			"\terrno = %d error = %s\n",en,strerror(en));
+		WARN(midi, "error writting unixdev #%d ! (%d != %ld)\n",
+			     MidiOutDev[wDevID].unixdev, count, 
+			     lpMidiHdr->dwBytesRecorded);
+		TRACE(midi, "\terrno = %d error = %s\n",en,strerror(en));
 		return MMSYSERR_NOTENABLED;
 	}
 	lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
 	lpMidiHdr->dwFlags |= MHDR_DONE;
 	if (MIDI_NotifyClient(wDevID, MOM_DONE, 0L, 0L) != MMSYSERR_NOERROR) {
-		dprintf_warn(midi,"Linux 'modLongData' // can't notify client !\n");
+		WARN(midi,"can't notify client !\n");
 		return MMSYSERR_INVALPARAM;
 	}
 	return MMSYSERR_NOERROR;
@@ -1255,14 +1240,13 @@
 static DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(midi,
-		  "modPrepare(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
+	TRACE(midi, "(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
 	if (MidiOutDev[wDevID].unixdev == 0) {
-		dprintf_warn(midi,"Linux 'modPrepare' // can't prepare !\n");
+		WARN(midi,"can't prepare !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	if (MidiOutDev[wDevID].lpQueueHdr != NULL) {
-		dprintf_info(midi,"Linux 'modPrepare' // already prepare !\n");
+		TRACE(midi,"already prepare !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	MidiOutDev[wDevID].dwTotalPlayed = 0;
@@ -1282,10 +1266,9 @@
 static DWORD modUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
 {
 #if defined(linux) || defined(__FreeBSD__)
-	dprintf_info(midi,
-		"modUnprepare(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
+	TRACE(midi, "(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
 	if (MidiOutDev[wDevID].unixdev == 0) {
-		dprintf_warn(midi,"Linux 'modUnprepare' // can't unprepare !\n");
+		WARN(midi,"can't unprepare !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	return MMSYSERR_NOERROR;
@@ -1299,7 +1282,7 @@
  */
 static DWORD modReset(WORD wDevID)
 {
-	dprintf_info(midi, "modReset(%04X);\n", wDevID);
+	TRACE(midi, "(%04X);\n", wDevID);
 	return MMSYSERR_NOTENABLED;
 }
 
@@ -1310,7 +1293,7 @@
 DWORD modMessage(WORD wDevID, WORD wMsg, DWORD dwUser, 
 					DWORD dwParam1, DWORD dwParam2)
 {
-	dprintf_info(midi, "modMessage(%04X, %04X, %08lX, %08lX, %08lX);\n", 
+	TRACE(midi, "(%04X, %04X, %08lX, %08lX, %08lX);\n", 
 			wDevID, wMsg, dwUser, dwParam1, dwParam2);
 	switch(wMsg) {
 	case MODM_OPEN:
diff --git a/multimedia/mixer.c b/multimedia/mixer.c
index 9bcb24d..f37b931 100644
--- a/multimedia/mixer.c
+++ b/multimedia/mixer.c
@@ -38,10 +38,10 @@
 #ifdef linux
 	int 		mixer,mask;
 
-	dprintf_info(mmaux,"MIX_GetDevCaps(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize);
+	TRACE(mmaux,"(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize);
 	if (lpCaps == NULL) return MMSYSERR_NOTENABLED;
 	if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
-		dprintf_warn(mmaux, "MIX_GetDevCaps // mixer device not available !\n");
+		WARN(mmaux, "mixer device not available !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	lpCaps->wMid = 0xAA;
@@ -77,7 +77,7 @@
 #ifdef linux
 	int 		mixer,i,j,devmask,recsrc,recmask;
 
-	dprintf_info(mmaux,"MIX_GetDevLineInfo(%04X, %p, %lu);\n", wDevID, lpml, fdwInfo);
+	TRACE(mmaux,"(%04X, %p, %lu);\n", wDevID, lpml, fdwInfo);
 	if (lpml == NULL) return MMSYSERR_NOTENABLED;
 	if ((mixer = open(MIXER_DEV, O_RDWR)) < 0)
 		return MMSYSERR_NOTENABLED;
@@ -178,7 +178,7 @@
 {
 #ifdef linux
 
-	dprintf_info(mmaux,"MIX_Open(%04X, %p, %lu);\n",wDevID,lpmod,flags);
+	TRACE(mmaux,"(%04X, %p, %lu);\n",wDevID,lpmod,flags);
 	if (lpmod == NULL) return MMSYSERR_NOTENABLED;
 	/* hmm. We don't keep the mixer device open. So just pretend it works */
 	return MMSYSERR_NOERROR;
@@ -193,7 +193,7 @@
 DWORD mixMessage(WORD wDevID, WORD wMsg, DWORD dwUser, 
 					DWORD dwParam1, DWORD dwParam2)
 {
-	dprintf_info(mmaux,"mixMessage(%04X, %04X, %08lX, %08lX, %08lX);\n", 
+	TRACE(mmaux,"(%04X, %04X, %08lX, %08lX, %08lX);\n", 
 			wDevID, wMsg, dwUser, dwParam1, dwParam2);
 	switch(wMsg) {
 	case MXDM_GETDEVCAPS:
@@ -201,12 +201,13 @@
 	case MXDM_GETLINEINFO:
 		return MIX_GetLineInfo(wDevID,(LPMIXERLINE16)dwParam1,dwParam2);
 	case MXDM_GETNUMDEVS:
-		dprintf_info(mmsys,"MIX_GetNumDevs() return 1;\n");
+		TRACE(mmsys,"return 1;\n");
 		return 1;
 	case MXDM_OPEN:
 		return MIX_Open(wDevID,(LPMIXEROPENDESC)dwParam1,dwParam2);
 	default:
-		dprintf_warn(mmaux,"mixMessage // unknown message %d!\n",wMsg);
+		WARN(mmaux,"unknown message %d!\n",wMsg);
 	}
 	return MMSYSERR_NOTSUPPORTED;
 }
+
diff --git a/multimedia/mmaux.c b/multimedia/mmaux.c
index 14598b9..de953b3 100644
--- a/multimedia/mmaux.c
+++ b/multimedia/mmaux.c
@@ -23,7 +23,6 @@
 #include <machine/soundcard.h>
 #endif
 
-#define SOUND_DEV "/dev/dsp"
 #define MIXER_DEV "/dev/mixer"
 
 #ifdef SOUND_VERSION
@@ -46,15 +45,15 @@
 #ifdef linux
 	int 	mixer,volume;
 
-	dprintf_info(mmaux,"AUX_GetDevCaps(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize);
+	TRACE(mmaux,"(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize);
 	if (lpCaps == NULL) return MMSYSERR_NOTENABLED;
 	if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
-		dprintf_warn(mmaux, "AUX_GetDevCaps // mixer device not available !\n");
+		WARN(mmaux, "mixer device not available !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	if (ioctl(mixer, SOUND_MIXER_READ_LINE, &volume) == -1) {
 		close(mixer);
-		dprintf_warn(mmaux, "AUX_GetDevCaps // unable read mixer !\n");
+		WARN(mmaux, "unable read mixer !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	close(mixer);
@@ -117,49 +116,49 @@
 #ifdef linux
 	int 	mixer,volume,left,right,cmd;
 
-	dprintf_info(mmaux,"AUX_GetVolume(%04X, %p);\n", wDevID, lpdwVol);
+	TRACE(mmaux,"(%04X, %p);\n", wDevID, lpdwVol);
 	if (lpdwVol == NULL) return MMSYSERR_NOTENABLED;
 	if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
-		dprintf_warn(mmaux, "Linux 'AUX_GetVolume' // mixer device not available !\n");
+		WARN(mmaux, "mixer device not available !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	switch(wDevID) {
 		case 0:
-			dprintf_info(mmaux,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_PCM !\n");
+			TRACE(mmaux,"SOUND_MIXER_READ_PCM !\n");
 			cmd = SOUND_MIXER_READ_PCM;
 			break;
 		case 1:
-			dprintf_info(mmaux,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_SYNTH !\n");
+			TRACE(mmaux,"SOUND_MIXER_READ_SYNTH !\n");
 			cmd = SOUND_MIXER_READ_SYNTH;
 			break;
 		case 2:
-			dprintf_info(mmaux,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_CD !\n");
+			TRACE(mmaux,"SOUND_MIXER_READ_CD !\n");
 			cmd = SOUND_MIXER_READ_CD;
 			break;
 		case 3:
-			dprintf_info(mmaux,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_LINE !\n");
+			TRACE(mmaux,"SOUND_MIXER_READ_LINE !\n");
 			cmd = SOUND_MIXER_READ_LINE;
 			break;
 		case 4:
-			dprintf_info(mmaux,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_MIC !\n");
+			TRACE(mmaux,"SOUND_MIXER_READ_MIC !\n");
 			cmd = SOUND_MIXER_READ_MIC;
 			break;
 		case 5:
-			dprintf_info(mmaux,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_VOLUME !\n");
+			TRACE(mmaux,"SOUND_MIXER_READ_VOLUME !\n");
 			cmd = SOUND_MIXER_READ_VOLUME;
 			break;
 		default:
-			dprintf_warn(mmaux, "Linux 'AUX_GetVolume' // invalid device id=%04X !\n", wDevID);
+			WARN(mmaux, "invalid device id=%04X !\n", wDevID);
 			return MMSYSERR_NOTENABLED;
 		}
 	if (ioctl(mixer, cmd, &volume) == -1) {
-		dprintf_warn(mmaux, "Linux 'AUX_GetVolume' // unable read mixer !\n");
+		WARN(mmaux, "unable read mixer !\n");
 		return MMSYSERR_NOTENABLED;
 	}
 	close(mixer);
 	left = volume & 0x7F;
 	right = (volume >> 8) & 0x7F;
-	dprintf_info(mmaux,"Linux 'AUX_GetVolume' // left=%d right=%d !\n", left, right);
+	TRACE(mmaux,"left=%d right=%d !\n", left, right);
 	*lpdwVol = MAKELONG(left << 9, right << 9);
 	return MMSYSERR_NOERROR;
 #else
@@ -176,44 +175,44 @@
 	int 	mixer;
 	int		volume;
 	int		cmd;
-	dprintf_info(mmaux,"AUX_SetVolume(%04X, %08lX);\n", wDevID, dwParam);
+	TRACE(mmaux,"(%04X, %08lX);\n", wDevID, dwParam);
 	volume = (LOWORD(dwParam) >> 9 & 0x7F) + 
 		((HIWORD(dwParam) >> 9  & 0x7F) << 8);
 	if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
-		dprintf_warn(mmaux, "Linux 'AUX_SetVolume' // mixer device not available !\n");
+		WARN(mmaux, "mixer device not available !\n");
 		return MMSYSERR_NOTENABLED;
 		}
 	switch(wDevID) {
 		case 0:
-			dprintf_info(mmaux,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_PCM !\n");
+			TRACE(mmaux,"SOUND_MIXER_WRITE_PCM !\n");
 			cmd = SOUND_MIXER_WRITE_PCM;
 			break;
 		case 1:
-			dprintf_info(mmaux,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_SYNTH !\n");
+			TRACE(mmaux,"SOUND_MIXER_WRITE_SYNTH !\n");
 			cmd = SOUND_MIXER_WRITE_SYNTH;
 			break;
 		case 2:
-			dprintf_info(mmaux,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_CD !\n");
+			TRACE(mmaux,"SOUND_MIXER_WRITE_CD !\n");
 			cmd = SOUND_MIXER_WRITE_CD;
 			break;
 		case 3:
-			dprintf_info(mmaux,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_LINE !\n");
+			TRACE(mmaux,"SOUND_MIXER_WRITE_LINE !\n");
 			cmd = SOUND_MIXER_WRITE_LINE;
 			break;
 		case 4:
-			dprintf_info(mmaux,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_MIC !\n");
+			TRACE(mmaux,"SOUND_MIXER_WRITE_MIC !\n");
 			cmd = SOUND_MIXER_WRITE_MIC;
 			break;
 		case 5:
-			dprintf_info(mmaux,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_VOLUME !\n");
+			TRACE(mmaux,"SOUND_MIXER_WRITE_VOLUME !\n");
 			cmd = SOUND_MIXER_WRITE_VOLUME;
 			break;
 		default:
-			dprintf_warn(mmaux, "Linux 'AUX_SetVolume' // invalid device id=%04X !\n", wDevID);
+			WARN(mmaux,"invalid device id=%04X !\n", wDevID);
 			return MMSYSERR_NOTENABLED;
 		}
     if (ioctl(mixer, cmd, &volume) == -1) {
-		dprintf_warn(mmaux, "Linux 'AUX_SetVolume' // unable set mixer !\n");
+		WARN(mmaux, "unable set mixer !\n");
 		return MMSYSERR_NOTENABLED;
 		}
 	close(mixer);
@@ -230,20 +229,20 @@
 DWORD auxMessage(WORD wDevID, WORD wMsg, DWORD dwUser, 
 					DWORD dwParam1, DWORD dwParam2)
 {
-	dprintf_info(mmaux,"auxMessage(%04X, %04X, %08lX, %08lX, %08lX);\n", 
+	TRACE(mmaux,"(%04X, %04X, %08lX, %08lX, %08lX);\n", 
 			wDevID, wMsg, dwUser, dwParam1, dwParam2);
 	switch(wMsg) {
 	case AUXDM_GETDEVCAPS:
 		return AUX_GetDevCaps(wDevID,(LPAUXCAPS16)dwParam1,dwParam2);
 	case AUXDM_GETNUMDEVS:
-		dprintf_info(mmaux,"AUX_GetNumDevs() return %d;\n", NumDev);
+		TRACE(mmaux,"return %d;\n", NumDev);
 		return NumDev;
 	case AUXDM_GETVOLUME:
 		return AUX_GetVolume(wDevID,(LPDWORD)dwParam1);
 	case AUXDM_SETVOLUME:
 		return AUX_SetVolume(wDevID,dwParam1);
 	default:
-		dprintf_warn(mmaux, "auxMessage // unknown message !\n");
+		WARN(mmaux, "unknown message !\n");
 	}
 	return MMSYSERR_NOTSUPPORTED;
 }
diff --git a/multimedia/mmio.c b/multimedia/mmio.c
index 597350a..87f9b1e 100644
--- a/multimedia/mmio.c
+++ b/multimedia/mmio.c
@@ -26,7 +26,7 @@
 *               mmioDosIOProc           [internal]
 */
 static LRESULT mmioDosIOProc(LPMMIOINFO16 lpmmioinfo, UINT16 uMessage, LPARAM lParam1, LPARAM lParam2) {
-	dprintf_info(mmio, "mmioDosIOProc(%p, %X, %ld, %ld);\n", lpmmioinfo, uMessage, lParam1, lParam2);
+	TRACE(mmio, "(%p, %X, %ld, %ld);\n", lpmmioinfo, uMessage, lParam1, lParam2);
 
 	switch (uMessage) {
 
@@ -42,7 +42,7 @@
 			LPSTR szFileName = (LPSTR) lParam1;
 
 			if (lpmmioinfo->dwFlags & MMIO_GETTEMP) {
-				dprintf_fixme(mmio, "mmioDosIOProc // MMIO_GETTEMP not implemented\n");
+				FIXME(mmio, "MMIO_GETTEMP not implemented\n");
 				return MMIOERR_CANNOTOPEN;
 			}
 
@@ -144,12 +144,12 @@
              * Returns: zero on success, non-zero on failure
              */
 
-            dprintf_fixme(mmio, "mmioDosIOProc: MMIOM_RENAME unimplemented\n");
+            FIXME(mmio, "MMIOM_RENAME unimplemented\n");
             return MMIOERR_FILENOTFOUND;
 		}
 
 		default:
-			dprintf_warn(mmio, "mmioDosIOProc: unexpected message %u\n", uMessage);
+			WARN(mmio, "unexpected message %u\n", uMessage);
 			return 0;
 	}
 	
@@ -195,7 +195,7 @@
 	HMMIO16 hmmio;
 	UINT16 result;
 
-	dprintf_info(mmio, "mmioOpen('%s', %p, %08lX);\n", szFileName, lpmmioinfo, dwOpenFlags);
+	TRACE(mmio, "('%s', %p, %08lX);\n", szFileName, lpmmioinfo, dwOpenFlags);
 
 	hmmio = GlobalAlloc16(GHND, sizeof(MMIOINFO16));
 	lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio);
@@ -256,7 +256,7 @@
 	LPMMIOINFO16 lpmminfo;
 	UINT16 result;
 
-	dprintf_info(mmio, "mmioClose(%04X, %04X);\n", hmmio, uFlags);
+	TRACE(mmio, "(%04X, %04X);\n", hmmio, uFlags);
 
 	lpmminfo = (LPMMIOINFO16) GlobalLock16(hmmio);
 	if (lpmminfo == NULL)
@@ -286,7 +286,7 @@
 	LONG count;
 	LPMMIOINFO16 lpmminfo;
 
-	dprintf_info(mmio, "mmioRead(%04X, %p, %ld);\n", hmmio, pch, cch);
+	TRACE(mmio, "(%04X, %p, %ld);\n", hmmio, pch, cch);
 
 	lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio);
 	if (lpmminfo == NULL)
@@ -295,7 +295,7 @@
 	count = mmioSendMessage(hmmio, MMIOM_READ, (LPARAM) pch, (LPARAM) cch);
 
 	GlobalUnlock16(hmmio);
-	dprintf_info(mmio, "mmioRead // count=%ld\n", count);
+	TRACE(mmio, "count=%ld\n", count);
 	return count;
 }
 
@@ -309,7 +309,7 @@
 	LONG count;
 	LPMMIOINFO16 lpmminfo;
 
-	dprintf_info(mmio, "mmioWrite(%04X, %p, %ld);\n", hmmio, pch, cch);
+	TRACE(mmio, "(%04X, %p, %ld);\n", hmmio, pch, cch);
 
 	lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio);
 	if (lpmminfo == NULL)
@@ -318,7 +318,7 @@
 	count = mmioSendMessage(hmmio, MMIOM_WRITE, (LPARAM) pch, (LPARAM) cch);
 
 	GlobalUnlock16(hmmio);
-	dprintf_info(mmio, "mmioWrite // count=%ld\n", count);
+	TRACE(mmio, "count=%ld\n", count);
 	return count;
 }
 
@@ -330,7 +330,7 @@
 	int offset;
 	LPMMIOINFO16 lpmminfo;
 
-	dprintf_info(mmio, "mmioSeek(%04X, %08lX, %d);\n", hmmio, lOffset, iOrigin);
+	TRACE(mmio, "(%04X, %08lX, %d);\n", hmmio, lOffset, iOrigin);
 
 	lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio);
 	if (lpmminfo == NULL)
@@ -348,7 +348,7 @@
 UINT16 WINAPI mmioGetInfo(HMMIO16 hmmio, MMIOINFO16 * lpmmioinfo, UINT16 uFlags)
 {
 	LPMMIOINFO16	lpmminfo;
-	dprintf_info(mmio, "mmioGetInfo\n");
+	TRACE(mmio, "mmioGetInfo\n");
 	lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio);
 	if (lpmminfo == NULL) return 0;
 	memcpy(lpmmioinfo, lpmminfo, sizeof(MMIOINFO16));
@@ -362,7 +362,7 @@
 UINT16 WINAPI mmioSetInfo(HMMIO16 hmmio, const MMIOINFO16 * lpmmioinfo, UINT16 uFlags)
 {
 	LPMMIOINFO16	lpmminfo;
-	dprintf_info(mmio, "mmioSetInfo\n");
+	TRACE(mmio, "mmioSetInfo\n");
 	lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio);
 	if (lpmminfo == NULL) return 0;
 	GlobalUnlock16(hmmio);
@@ -375,7 +375,7 @@
 UINT16 WINAPI mmioSetBuffer(HMMIO16 hmmio, LPSTR pchBuffer, 
                             LONG cchBuffer, UINT16 uFlags)
 {
-	dprintf_fixme(mmio, "mmioSetBuffer // empty stub \n");
+	FIXME(mmio, "empty stub \n");
 	return 0;
 }
 
@@ -385,7 +385,7 @@
 UINT16 WINAPI mmioFlush(HMMIO16 hmmio, UINT16 uFlags)
 {
 	LPMMIOINFO16	lpmminfo;
-	dprintf_info(mmio, "mmioFlush(%04X, %04X)\n", hmmio, uFlags);
+	TRACE(mmio, "(%04X, %04X)\n", hmmio, uFlags);
 	lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio);
 	if (lpmminfo == NULL) return 0;
 	GlobalUnlock16(hmmio);
@@ -399,7 +399,7 @@
 {
 	int		count = 0;
 	LPMMIOINFO16	lpmminfo;
-	dprintf_info(mmio, "mmioAdvance\n");
+	TRACE(mmio, "mmioAdvance\n");
 	lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio);
 	if (lpmminfo == NULL) return 0;
 	if (uFlags == MMIO_READ) {
@@ -441,7 +441,7 @@
  */
 FOURCC WINAPI mmioStringToFOURCC16(LPCSTR sz, UINT16 uFlags)
 {
-	dprintf_fixme(mmio, "mmioStringToFOURCC // empty stub \n");
+	FIXME(mmio, "empty stub \n");
 	return 0;
 }
 
@@ -451,7 +451,7 @@
 LPMMIOPROC16 WINAPI mmioInstallIOProc16(FOURCC fccIOProc, 
                                         LPMMIOPROC16 pIOProc, DWORD dwFlags)
 {
-	dprintf_info(mmio, "mmioInstallIOProc(%ld, %p, %08lX)\n",
+	TRACE(mmio, "(%ld, %p, %08lX)\n",
 				 fccIOProc, pIOProc, dwFlags);
 
 	if (dwFlags & MMIO_GLOBALPROC) {
@@ -483,7 +483,7 @@
 LPMMIOPROC32 WINAPI mmioInstallIOProc32A(FOURCC fccIOProc, 
                                          LPMMIOPROC32 pIOProc, DWORD dwFlags)
 {
-	dprintf_fixme(mmio, "mmioInstallIOProcA (%c%c%c%c,%p,0x%08lx)// empty stub \n",
+	FIXME(mmio, "(%c%c%c%c,%p,0x%08lx) -- empty stub \n",
                      (char)((fccIOProc&0xff000000)>>24),
                      (char)((fccIOProc&0x00ff0000)>>16),
                      (char)((fccIOProc&0x0000ff00)>> 8),
@@ -517,10 +517,10 @@
 #endif
 
 	if (msg)
-		dprintf_info(mmio, "mmioSendMessage(%04X, %s, %ld, %ld)\n",
+		TRACE(mmio, "(%04X, %s, %ld, %ld)\n",
 					 hmmio, msg, lParam1, lParam2);
 	else
-		dprintf_info(mmio, "mmioSendMessage(%04X, %u, %ld, %ld)\n",
+		TRACE(mmio, "(%04X, %u, %ld, %ld)\n",
 					 hmmio, uMessage, lParam1, lParam2);
 	
 	lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio);
@@ -543,20 +543,20 @@
 {
 	DWORD	dwfcc, dwOldPos;
 
-	dprintf_info(mmio, "mmioDescend(%04X, %p, %p, %04X);\n", 
+	TRACE(mmio, "(%04X, %p, %p, %04X);\n", 
 				hmmio, lpck, lpckParent, uFlags);
 
 	if (lpck == NULL)
 	    return 0;
 
 	dwfcc = lpck->ckid;
-	dprintf_info(mmio, "mmioDescend // dwfcc=%08lX\n", dwfcc);
+	TRACE(mmio, "dwfcc=%08lX\n", dwfcc);
 
 	dwOldPos = mmioSeek(hmmio, 0, SEEK_CUR);
-	dprintf_info(mmio, "mmioDescend // dwOldPos=%ld\n", dwOldPos);
+	TRACE(mmio, "dwOldPos=%ld\n", dwOldPos);
 
 	if (lpckParent != NULL) {
-		dprintf_info(mmio, "mmioDescend // seek inside parent at %ld !\n", lpckParent->dwDataOffset);
+		TRACE(mmio, "seek inside parent at %ld !\n", lpckParent->dwDataOffset);
 		dwOldPos = mmioSeek(hmmio, lpckParent->dwDataOffset, SEEK_SET);
 	}
 /*
@@ -568,19 +568,19 @@
 		(uFlags & MMIO_FINDLIST)) {
 */
 	if ((uFlags & MMIO_FINDCHUNK) || (uFlags & MMIO_FINDLIST)) {
-		dprintf_info(mmio, "mmioDescend // MMIO_FINDxxxx dwfcc=%08lX !\n", dwfcc);
+		TRACE(mmio, "MMIO_FINDxxxx dwfcc=%08lX !\n", dwfcc);
 		while (TRUE) {
 		        LONG ix;
 
 			ix = mmioRead(hmmio, (LPSTR)lpck, sizeof(MMCKINFO));
-			dprintf_info(mmio, "mmioDescend // after _lread32 ix = %ld req = %d, errno = %d\n",ix,sizeof(MMCKINFO),errno);
+			TRACE(mmio, "after _lread32 ix = %ld req = %d, errno = %d\n",ix,sizeof(MMCKINFO),errno);
 			if (ix < sizeof(MMCKINFO)) {
 
 				mmioSeek(hmmio, dwOldPos, SEEK_SET);
-				dprintf_warn(mmio, "mmioDescend // return ChunkNotFound\n");
+				WARN(mmio, "return ChunkNotFound\n");
 				return MMIOERR_CHUNKNOTFOUND;
 			}
-			dprintf_info(mmio, "mmioDescend // dwfcc=%08lX ckid=%08lX cksize=%08lX !\n", 
+			TRACE(mmio, "dwfcc=%08lX ckid=%08lX cksize=%08lX !\n", 
 									dwfcc, lpck->ckid, lpck->cksize);
 			if (dwfcc == lpck->ckid)
 				break;
@@ -594,7 +594,7 @@
 	else {
 		if (mmioRead(hmmio, (LPSTR)lpck, sizeof(MMCKINFO)) < sizeof(MMCKINFO)) {
 			mmioSeek(hmmio, dwOldPos, SEEK_SET);
-			dprintf_warn(mmio, "mmioDescend // return ChunkNotFound 2nd\n");
+			WARN(mmio, "return ChunkNotFound 2nd\n");
 			return MMIOERR_CHUNKNOTFOUND;
 		}
 	}
@@ -603,9 +603,9 @@
 		lpck->dwDataOffset += sizeof(DWORD);
 	mmioSeek(hmmio, lpck->dwDataOffset, SEEK_SET);
 
-	dprintf_info(mmio, "mmioDescend // lpck->ckid=%08lX lpck->cksize=%ld !\n", 
+	TRACE(mmio, "lpck->ckid=%08lX lpck->cksize=%ld !\n", 
 								lpck->ckid, lpck->cksize);
-	dprintf_info(mmio, "mmioDescend // lpck->fccType=%08lX !\n", lpck->fccType);
+	TRACE(mmio, "lpck->fccType=%08lX !\n", lpck->fccType);
 
 	return 0;
 }
@@ -615,7 +615,7 @@
 */
 UINT16 WINAPI mmioAscend(HMMIO16 hmmio, MMCKINFO * lpck, UINT16 uFlags)
 {
-	dprintf_fixme(mmio, "mmioAscend // empty stub !\n");
+	FIXME(mmio, "empty stub !\n");
 	return 0;
 }
 
@@ -624,7 +624,7 @@
 */
 UINT16 WINAPI mmioCreateChunk(HMMIO16 hmmio, MMCKINFO * lpck, UINT16 uFlags)
 {
-	dprintf_fixme(mmio, "mmioCreateChunk // empty stub \n");
+	FIXME(mmio, "empty stub \n");
 	return 0;
 }
 
@@ -639,7 +639,7 @@
 	LPMMIOINFO16 lpmminfo;
 	HMMIO16 hmmio;
 
-	dprintf_info(mmio, "mmioRename('%s', '%s', %p, %08lX);\n",
+	TRACE(mmio, "('%s', '%s', %p, %08lX);\n",
 				 szFileName, szNewFileName, lpmmioinfo, dwRenameFlags);
 
 	hmmio = GlobalAlloc16(GHND, sizeof(MMIOINFO16));
diff --git a/multimedia/mmsystem.c b/multimedia/mmsystem.c
index 35e94e7..12e55d7 100644
--- a/multimedia/mmsystem.c
+++ b/multimedia/mmsystem.c
@@ -121,8 +121,8 @@
  */
 BOOL32 WINAPI PlaySound32A(LPCSTR pszSound, HMODULE32 hmod, DWORD fdwSound)
 {
-  dprintf_info(mmsys, "PlaySoundA: pszSound='%p' hmod=%04X fdwSound=%08lX\n",
-		pszSound, hmod, fdwSound);
+  TRACE(mmsys, "pszSound='%p' hmod=%04X fdwSound=%08lX\n",
+	       pszSound, hmod, fdwSound);
   if(hmod != 0 || !(fdwSound & SND_FILENAME)) {
     fprintf(stderr, "PlaySoundA: only disk sound files are supported\n");
     return FALSE;
@@ -154,37 +154,37 @@
 	char			str[128];
 	LPSTR			ptr;
 
-	dprintf_info(mmsys, "sndPlaySound // SoundName='%s' uFlags=%04X !\n", 
+	TRACE(mmsys, "SoundName='%s' uFlags=%04X !\n", 
 									lpszSoundName, uFlags);
 	if (lpszSoundName == NULL) {
-		dprintf_info(mmsys, "sndPlaySound // Stop !\n");
+		TRACE(mmsys, "Stop !\n");
 		return FALSE;
 		}
 	hmmio = mmioOpen16((LPSTR)lpszSoundName, NULL, 
 		MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
 
 	if (uFlags & SND_MEMORY) {
-		dprintf_fixme(mmsys, "sndPlaySound // SND_MEMORY flag not implemented!\n");
+		FIXME(mmsys, "SND_MEMORY flag not implemented!\n");
 		return FALSE;
 	}
 
 	if (hmmio == 0) 
 	{
-		dprintf_info(mmsys, "sndPlaySound // searching in SystemSound List !\n");
+		TRACE(mmsys, "searching in SystemSound List !\n");
 		GetProfileString32A("Sounds", (LPSTR)lpszSoundName, "", str, sizeof(str));
 		if (strlen(str) == 0) return FALSE;
 		if ( (ptr = (LPSTR)strchr(str, ',')) != NULL) *ptr = '\0';
 		hmmio = mmioOpen16(str, NULL, MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
 		if (hmmio == 0) 
 		{
-			dprintf_warn(mmsys, "sndPlaySound // can't find SystemSound='%s' !\n", str);
+			WARN(mmsys, "can't find SystemSound='%s' !\n", str);
 			return FALSE;
 		}
 	}
 
 	if (mmioDescend(hmmio, &ckMainRIFF, NULL, 0) == 0) 
         {
-	    dprintf_info(mmsys, "sndPlaySound // ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n",
+	    TRACE(mmsys, "ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n",
 				(LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType, ckMainRIFF.cksize);
 
 	    if ((ckMainRIFF.ckid == FOURCC_RIFF) &&
@@ -198,19 +198,19 @@
 		{
 		    PCMWAVEFORMAT           pcmWaveFormat;
 
-		    dprintf_info(mmsys, "sndPlaySound // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
+		    TRACE(mmsys, "Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n",
 				(LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType, mmckInfo.cksize);
 
 		    if (mmioRead(hmmio, (HPSTR) &pcmWaveFormat,
 			        (long) sizeof(PCMWAVEFORMAT)) == (long) sizeof(PCMWAVEFORMAT))
 		    {
 
-			dprintf_info(mmsys, "sndPlaySound // wFormatTag=%04X !\n", pcmWaveFormat.wf.wFormatTag);
-			dprintf_info(mmsys, "sndPlaySound // nChannels=%d \n", pcmWaveFormat.wf.nChannels);
-			dprintf_info(mmsys, "sndPlaySound // nSamplesPerSec=%ld\n", pcmWaveFormat.wf.nSamplesPerSec);
-			dprintf_info(mmsys, "sndPlaySound // nAvgBytesPerSec=%ld\n", pcmWaveFormat.wf.nAvgBytesPerSec);
-			dprintf_info(mmsys, "sndPlaySound // nBlockAlign=%d \n", pcmWaveFormat.wf.nBlockAlign);
-			dprintf_info(mmsys, "sndPlaySound // wBitsPerSample=%u !\n", pcmWaveFormat.wBitsPerSample);
+			TRACE(mmsys, "wFormatTag=%04X !\n", pcmWaveFormat.wf.wFormatTag);
+			TRACE(mmsys, "nChannels=%d \n", pcmWaveFormat.wf.nChannels);
+			TRACE(mmsys, "nSamplesPerSec=%ld\n", pcmWaveFormat.wf.nSamplesPerSec);
+			TRACE(mmsys, "nAvgBytesPerSec=%ld\n", pcmWaveFormat.wf.nAvgBytesPerSec);
+			TRACE(mmsys, "nBlockAlign=%d \n", pcmWaveFormat.wf.nBlockAlign);
+			TRACE(mmsys, "wBitsPerSample=%u !\n", pcmWaveFormat.wBitsPerSample);
 
 			mmckInfo.ckid = mmioFOURCC('d', 'a', 't', 'a');
 			if (mmioDescend(hmmio, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK) == 0)
@@ -218,7 +218,7 @@
 			    WAVEOPENDESC	waveDesc;
 			    DWORD		dwRet;
 
-			    dprintf_info(mmsys, "sndPlaySound // Chunk Found \
+			    TRACE(mmsys, "Chunk Found \
  ckid=%.4s fccType=%.4s cksize=%08lX \n", (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType, mmckInfo.cksize);
 
 			    pcmWaveFormat.wf.nAvgBytesPerSec = pcmWaveFormat.wf.nSamplesPerSec * 
@@ -258,7 +258,7 @@
 
 				    bRet = TRUE;
 				}
-				else dprintf_warn(mmsys, "sndPlaySound // can't prepare WaveOut device !\n");
+				else WARN(mmsys, "can't prepare WaveOut device !\n");
 
 				GlobalUnlock16(hData);
 				GlobalFree16(hData);
@@ -287,7 +287,7 @@
  */
 UINT16 WINAPI mmsystemGetVersion16()
 {
-	dprintf_info(mmsys, "mmsystemGetVersion // 3.10 (Win95?)\n");
+	TRACE(mmsys, "3.10 (Win95?)\n");
 	return 0x030a;
 }
 
@@ -308,14 +308,14 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "DriverCallback(%08lX, %04X, %04X, %04X, %08lX, %08lX, %08lX); !\n",
+	TRACE(mmsys, "(%08lX, %04X, %04X, %04X, %08lX, %08lX, %08lX); !\n",
 		dwCallBack, uFlags, hDev, wMsg, dwUser, dwParam1, dwParam2);
 	switch(uFlags & DCB_TYPEMASK) {
 		case DCB_NULL:
-			dprintf_info(mmsys, "DriverCallback() // CALLBACK_NULL !\n");
+			TRACE(mmsys, "CALLBACK_NULL !\n");
 			break;
 		case DCB_WINDOW:
-			dprintf_info(mmsys, "DriverCallback() // CALLBACK_WINDOW = %04lX handle = %04X!\n",dwCallBack,hDev);
+			TRACE(mmsys, "CALLBACK_WINDOW = %04lX handle = %04X!\n",dwCallBack,hDev);
 			if (!IsWindow32(dwCallBack)) return FALSE;
 			lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hDev);
 			if (lpDesc == NULL) return FALSE;
@@ -323,10 +323,10 @@
 			PostMessage16((HWND16)dwCallBack, wMsg, hDev, dwParam1);
 			break;
 		case DCB_TASK:
-			dprintf_info(mmsys, "DriverCallback() // CALLBACK_TASK !\n");
+			TRACE(mmsys, "CALLBACK_TASK !\n");
 			return FALSE;
 		case DCB_FUNCTION:
-			dprintf_info(mmsys, "DriverCallback() // CALLBACK_FUNCTION !\n");
+			TRACE(mmsys, "CALLBACK_FUNCTION !\n");
 			Callbacks->CallDriverCallback( (FARPROC16)dwCallBack,
                                                        hDev, wMsg, dwUser,
                                                        dwParam1, dwParam2 );
@@ -364,7 +364,7 @@
 	UINT16	count;
 
 	count = mixMessage(0,MXDM_GETNUMDEVS,0L,0L,0L);
-	dprintf_info(mmaux,"mixerGetNumDevs returns %d\n",count);
+	TRACE(mmaux,"mixerGetNumDevs returns %d\n",count);
 	return count;
 }
 
@@ -698,9 +698,9 @@
 UINT16 WINAPI auxGetNumDevs16()
 {
 	UINT16	count = 0;
-	dprintf_info(mmsys, "auxGetNumDevs !\n");
+	TRACE(mmsys, "auxGetNumDevs !\n");
 	count += auxMessage(0, AUXDM_GETNUMDEVS, 0L, 0L, 0L);
-	dprintf_info(mmsys, "auxGetNumDevs return %u \n", count);
+	TRACE(mmsys, "auxGetNumDevs return %u \n", count);
 	return count;
 }
 
@@ -743,7 +743,7 @@
  */
 UINT16 WINAPI auxGetDevCaps16(UINT16 uDeviceID,LPAUXCAPS16 lpCaps, UINT16 uSize)
 {
-	dprintf_info(mmsys, "auxGetDevCaps(%04X, %p, %d) !\n", 
+	TRACE(mmsys, "(%04X, %p, %d) !\n", 
 					uDeviceID, lpCaps, uSize);
 	return auxMessage(uDeviceID, AUXDM_GETDEVCAPS,
 				0L, (DWORD)lpCaps, (DWORD)uSize);
@@ -762,7 +762,7 @@
  */
 UINT16 WINAPI auxGetVolume16(UINT16 uDeviceID, DWORD * lpdwVolume)
 {
-	dprintf_info(mmsys, "auxGetVolume(%04X, %p) !\n", uDeviceID, lpdwVolume);
+	TRACE(mmsys, "(%04X, %p) !\n", uDeviceID, lpdwVolume);
 	return auxMessage(uDeviceID, AUXDM_GETVOLUME, 0L, (DWORD)lpdwVolume, 0L);
 }
 
@@ -779,7 +779,7 @@
  */
 UINT16 WINAPI auxSetVolume16(UINT16 uDeviceID, DWORD dwVolume)
 {
-	dprintf_info(mmsys, "auxSetVolume(%04X, %08lX) !\n", uDeviceID, dwVolume);
+	TRACE(mmsys, "(%04X, %08lX) !\n", uDeviceID, dwVolume);
 	return auxMessage(uDeviceID, AUXDM_SETVOLUME, 0L, dwVolume, 0L);
 }
 
@@ -810,7 +810,7 @@
  */
 DWORD WINAPI auxOutMessage16(UINT16 uDeviceID, UINT16 uMessage, DWORD dw1, DWORD dw2)
 {
-	dprintf_info(mmsys, "auxOutMessage(%04X, %04X, %08lX, %08lX)\n", 
+	TRACE(mmsys, "(%04X, %04X, %08lX, %08lX)\n", 
 				uDeviceID, uMessage, dw1, dw2);
 	switch (uMessage) {
 	case AUXDM_GETNUMDEVS:
@@ -857,7 +857,7 @@
 BOOL16 WINAPI mciGetErrorString16(DWORD wError,LPSTR lpstrBuffer,UINT16 uLength)
 {
 	LPSTR	msgptr;
-	dprintf_info(mmsys, "mciGetErrorString(%08lX, %p, %d);\n", 
+	TRACE(mmsys, "(%08lX, %p, %d);\n", 
 	       wError, lpstrBuffer, uLength);
 	if ((lpstrBuffer == NULL) || (uLength < 1)) return(FALSE);
 	lpstrBuffer[0] = '\0';
@@ -1123,7 +1123,7 @@
 			break;
 	}
         lstrcpyn32A(lpstrBuffer, msgptr, uLength);
-	dprintf_info(mmsys, "mciGetErrorString // msg = %s;\n", msgptr);
+	TRACE(mmsys, "msg = %s;\n", msgptr);
 	return TRUE;
 }
 
@@ -1133,9 +1133,9 @@
  */
 BOOL16 WINAPI mciDriverNotify(HWND16 hWndCallBack, UINT16 wDevID, UINT16 wStatus)
 {
-	dprintf_info(mmsys, "mciDriverNotify(%04X, %u, %04X)\n", hWndCallBack, wDevID, wStatus);
+	TRACE(mmsys, "(%04X, %u, %04X)\n", hWndCallBack, wDevID, wStatus);
 	if (!IsWindow32(hWndCallBack)) return FALSE;
-	dprintf_info(mmsys, "mciDriverNotify // before PostMessage\n");
+	TRACE(mmsys, "before PostMessage\n");
 	PostMessage16( hWndCallBack, MM_MCINOTIFY, wStatus, 
                        MAKELONG(wDevID, 0));
 	return TRUE;
@@ -1154,23 +1154,23 @@
 	DWORD dwret;
 
 	lpParms = PTR_SEG_TO_LIN(lp16Parms);
-	dprintf_info(mmsys, "mciOpen(%08lX, %p (%p))\n", dwParam, lp16Parms, lpParms);
+	TRACE(mmsys, "(%08lX, %p (%p))\n", dwParam, lp16Parms, lpParms);
 	if (lp16Parms == NULL) return MCIERR_INTERNAL;
 
 	while(GetDrv(wDevID)->modp.wType != 0) {
 		wDevID = MMSYSTEM_NextDevID(wDevID);
 		if (!MMSYSTEM_DevIDValid(wDevID)) {
-			dprintf_info(mmsys, "MCI_OPEN // MAXMCIDRIVERS reached !\n");
+			TRACE(mmsys, "MAXMCIDRIVERS reached !\n");
 			return MCIERR_INTERNAL;
 		}
 	}
-	dprintf_info(mmsys, "mciOpen // wDevID=%04X \n", wDevID);
+	TRACE(mmsys, "wDevID=%04X \n", wDevID);
 	memcpy(GetOpenDrv(wDevID),lpParms,sizeof(*lpParms));
 
 	if (dwParam & MCI_OPEN_ELEMENT) {
 		char	*s,*t;
 
-		dprintf_info(mmsys,"mciOpen // lpstrElementName='%s'\n",
+		TRACE(mmsys,"lpstrElementName='%s'\n",
 			(char*)PTR_SEG_TO_LIN(lpParms->lpstrElementName)
 		);
 		s=(char*)PTR_SEG_TO_LIN(lpParms->lpstrElementName);
@@ -1178,7 +1178,7 @@
 		if (t) {
 			GetProfileString32A("mci extensions",t+1,"*",str,sizeof(str));
 			CharUpper32A(str);
-			dprintf_info(mmsys, "mciOpen // str = %s \n", str);
+			TRACE(mmsys, "str = %s \n", str);
 			if (strcmp(str, "CDAUDIO") == 0) {
 				uDevTyp = MCI_DEVTYPE_CD_AUDIO;
 			} else
@@ -1195,7 +1195,7 @@
 				uDevTyp = MCI_DEVTYPE_DIGITAL_VIDEO;
 			} else 
 			if (strcmp(str,"*") == 0) {
-				dprintf_info(mmsys,"No [mci extensions] entry for %s found.\n",t);
+				TRACE(mmsys,"No [mci extensions] entry for %s found.\n",t);
 				return MCIERR_EXTENSION_NOT_FOUND;
 #if testing16
 			} else  {
@@ -1208,7 +1208,7 @@
 					GetDrv(wDevID)->driverproc = GetProcAddress16(hmod,SEGPTR_GET(SEGPTR_STRDUP("DRIVERPROC")));
 					uDevTyp = MCI_DEVTYPE_OTHER;
 				} else {
-					dprintf_fixme(mmsys, "[mci extensions] entry %s for %s not supported.\n",str,t);
+					FIXME(mmsys, "[mci extensions] entry %s for %s not supported.\n",str,t);
 					return MCIERR_DEVICE_NOT_INSTALLED;
 				}
 #endif
@@ -1218,7 +1218,7 @@
 	}
 
 	if (dwParam & MCI_OPEN_ALIAS) {
-		dprintf_info(mmsys, "MCI_OPEN // Alias='%s' !\n",
+		TRACE(mmsys, "Alias='%s' !\n",
 			(char*)PTR_SEG_TO_LIN(lpParms->lpstrAlias));
                 GetOpenDrv(wDevID)->lpstrAlias = (LPSTR)SEGPTR_GET(
                     SEGPTR_STRDUP((char*)PTR_SEG_TO_LIN(lpParms->lpstrAlias)));
@@ -1226,12 +1226,12 @@
 	}
 	if (dwParam & MCI_OPEN_TYPE) {
 		if (dwParam & MCI_OPEN_TYPE_ID) {
-			dprintf_info(mmsys, "MCI_OPEN // Dev=%08lx!\n", (DWORD)lpParms->lpstrDeviceType);
+			TRACE(mmsys, "Dev=%08lx!\n", (DWORD)lpParms->lpstrDeviceType);
 			uDevTyp = LOWORD((DWORD)lpParms->lpstrDeviceType);
  			GetOpenDrv(wDevID)->lpstrDeviceType=(LPSTR)lpParms->lpstrDeviceType;
 		} else {
 			if (lpParms->lpstrDeviceType == NULL) return MCIERR_INTERNAL;
-			dprintf_info(mmsys, "MCI_OPEN // Dev='%s' !\n",
+			TRACE(mmsys, "Dev='%s' !\n",
                               (char*)PTR_SEG_TO_LIN(lpParms->lpstrDeviceType));
                         GetOpenDrv(wDevID)->lpstrDeviceType=(LPSTR)SEGPTR_GET(
               SEGPTR_STRDUP((char*)PTR_SEG_TO_LIN(lpParms->lpstrDeviceType)));
@@ -1272,7 +1272,7 @@
 	GetDrv(wDevID)->modp.wType = uDevTyp;
 	GetDrv(wDevID)->modp.wDeviceID = 0;  /* FIXME? for multiple devices */
 	lpParms->wDeviceID = wDevID;
-	dprintf_info(mmsys, "MCI_OPEN // mcidev=%d, uDevTyp=%04X wDeviceID=%04X !\n", 
+	TRACE(mmsys, "mcidev=%d, uDevTyp=%04X wDeviceID=%04X !\n", 
 				wDevID, uDevTyp, lpParms->wDeviceID);
 	switch(uDevTyp)
         {
@@ -1293,12 +1293,12 @@
 				  dwParam, (DWORD)lp16Parms);
 	  break;
         case MCI_DEVTYPE_DIGITAL_VIDEO:
-	  dprintf_info(mmsys, "MCI_OPEN // No DIGITAL_VIDEO yet !\n");
+	  TRACE(mmsys, "No DIGITAL_VIDEO yet !\n");
 	  return MCIERR_DEVICE_NOT_INSTALLED;
         default:
 #if testing16
 	  dwret = Callbacks->CallDriverProc(GetDrv(wDevID)->driverproc,0,GetDrv(wDevID)->hdrv,MCI_OPEN_DRIVER,dwParam,(DWORD)lp16Parms);
-	  dprintf_warn(mmsys, "MCI_OPEN // Invalid Device Name '%08lx' !\n", (DWORD)lpParms->lpstrDeviceType);
+	  WARN(mmsys, "Invalid Device Name '%08lx' !\n", (DWORD)lpParms->lpstrDeviceType);
 #endif
 	  return MCIERR_INVALID_DEVICE_NAME;
         }
@@ -1309,7 +1309,7 @@
 			  (dwret==0?MCI_NOTIFY_SUCCESSFUL:MCI_NOTIFY_FAILURE));
 
 	/* only handled devices fall through */
-	dprintf_info(mmsys, "MCI_OPEN // wDevID = %04X wDeviceID = %d dwret = %ld\n",wDevID, lpParms->wDeviceID, dwret);
+	TRACE(mmsys, "wDevID = %04X wDeviceID = %d dwret = %ld\n",wDevID, lpParms->wDeviceID, dwret);
 	return dwret;
 }
 
@@ -1336,7 +1336,7 @@
 {
 	DWORD	dwRet = MCIERR_INTERNAL;
 
-	dprintf_info(mmsys, "mciClose(%04x, %08lX, %p)\n", wDevID, dwParam, lpParms);
+	TRACE(mmsys, "(%04x, %08lX, %p)\n", wDevID, dwParam, lpParms);
 	switch(GetDrv(wDevID)->modp.wType) {
 	case MCI_DEVTYPE_CD_AUDIO:
 		dwRet = CDAUDIO_DriverProc(GetDrv(wDevID)->modp.wDeviceID,0,
@@ -1368,7 +1368,7 @@
 	  mciDriverNotify(lpParms->dwCallback,wDevID,
 			  (dwRet==0?MCI_NOTIFY_SUCCESSFUL:MCI_NOTIFY_FAILURE));
 
-	dprintf_info(mmsys, "mciClose() // returns %ld\n",dwRet);
+	TRACE(mmsys, "returns %ld\n",dwRet);
 	return dwRet;
 }
 
@@ -1383,23 +1383,23 @@
 	LPSTR	lpstrReturn;
 	DWORD	*lpdwRet;
 	LPSTR	SysFile = "SYSTEM.INI";
-	dprintf_info(mci, "mciSysInfo(%08lX, %08lX)\n", dwFlags, (DWORD)lpParms);
+	TRACE(mci, "(%08lX, %08lX)\n", dwFlags, (DWORD)lpParms);
 	lpstrReturn = PTR_SEG_TO_LIN(lpParms->lpstrReturn);
 	switch(dwFlags) {
 	case MCI_SYSINFO_QUANTITY:
-		dprintf_info(mci, "mciSysInfo // MCI_SYSINFO_QUANTITY \n");
+		TRACE(mci, "MCI_SYSINFO_QUANTITY \n");
 		lpdwRet = (DWORD *)lpstrReturn;
 		*(lpdwRet) = InstalledCount;
 		return 0;
 	case MCI_SYSINFO_INSTALLNAME:
-		dprintf_info(mci, "mciSysInfo // MCI_SYSINFO_INSTALLNAME \n");
+		TRACE(mci, "MCI_SYSINFO_INSTALLNAME \n");
 		if (lpInstallNames == NULL) {
 			InstalledCount = 0;
 			InstalledListLen = 0;
 			ptr = lpInstallNames = xmalloc(2048);
 			GetPrivateProfileString32A("mci", NULL, "", lpInstallNames, 2000, SysFile);
 			while(strlen(ptr) > 0) {
-				dprintf_info(mci, "---> '%s' \n", ptr);
+				TRACE(mci, "---> '%s' \n", ptr);
 				len = strlen(ptr) + 1;
 				ptr += len;
 				InstalledListLen += len;
@@ -1412,10 +1412,10 @@
 			strcpy(lpstrReturn, lpInstallNames);
 		return 0;
 	case MCI_SYSINFO_NAME:
-		dprintf_info(mci, "mciSysInfo // MCI_SYSINFO_NAME \n");
+		TRACE(mci, "MCI_SYSINFO_NAME \n");
 		return 0;
 	case MCI_SYSINFO_OPEN:
-		dprintf_info(mci, "mciSysInfo // MCI_SYSINFO_OPEN \n");
+		TRACE(mci, "MCI_SYSINFO_OPEN \n");
 		return 0;
 	}
 	return MMSYSERR_INVALPARAM;
@@ -1486,7 +1486,7 @@
 {
 	if (lpParms == NULL) return MCIERR_INTERNAL;
 	if (dwParam & MCI_SOUND_NAME)
-		dprintf_info(mci, "MCI_SOUND // file='%s' !\n", lpParms->lpstrSoundName);
+		TRACE(mci, "file='%s' !\n", lpParms->lpstrSoundName);
 	return MCIERR_INVALID_DEVICE_ID;
 }
  *
@@ -1566,7 +1566,7 @@
                             DWORD dwParam2)
 {
     HDRVR16 hDrv = 0;
-    dprintf_info(mci, "mciSendCommand(%04X, %s, %08lX, %08lX)\n", 
+    TRACE(mci, "(%04X, %s, %08lX, %08lX)\n", 
                 wDevID, _mciCommandToString(wMsg), dwParam1, dwParam2);
     switch(wMsg)
     {
@@ -1598,9 +1598,8 @@
         default:
 	    return Callbacks->CallDriverProc(GetDrv(wDevID)->driverproc,GetDrv(wDevID)->modp.wDeviceID,GetDrv(wDevID)->hdrv,MCI_CLOSE,dwParam1,dwParam2);
 
-            dprintf_warn(mci,
-                        "mciSendCommand() // unknown device type=%04X !\n", 
-                        GetDrv(wDevID)->modp.wType);
+            WARN(mci, "unknown device type=%04X !\n", 
+			 GetDrv(wDevID)->modp.wType);
         }
     }
     return MMSYSERR_INVALPARAM;
@@ -1613,7 +1612,7 @@
 {
     UINT16 wDevID;
 
-    dprintf_info(mci, "mciGetDeviceID(\"%s\")\n", lpstrName);
+    TRACE(mci, "(\"%s\")\n", lpstrName);
     if (lpstrName && !lstrcmpi32A(lpstrName, "ALL"))
         return MCI_ALL_DEVICE_ID;
 
@@ -1682,9 +1681,9 @@
 UINT16 WINAPI midiOutGetNumDevs16(void)
 {
 	UINT16	count = 0;
-	dprintf_info(mmsys, "midiOutGetNumDevs\n");
+	TRACE(mmsys, "midiOutGetNumDevs\n");
 	count += modMessage(0, MODM_GETNUMDEVS, 0L, 0L, 0L);
-	dprintf_info(mmsys, "midiOutGetNumDevs return %u \n", count);
+	TRACE(mmsys, "midiOutGetNumDevs return %u \n", count);
 	return count;
 }
 
@@ -1734,7 +1733,7 @@
  */
 UINT16 WINAPI midiOutGetDevCaps16(UINT16 uDeviceID,LPMIDIOUTCAPS16 lpCaps, UINT16 uSize)
 {
-	dprintf_info(mmsys, "midiOutGetDevCaps\n");
+	TRACE(mmsys, "midiOutGetDevCaps\n");
 	return modMessage(uDeviceID,MODM_GETDEVCAPS,0,(DWORD)lpCaps,uSize);
 }
 
@@ -1743,7 +1742,7 @@
  */
 UINT32 WINAPI midiOutGetErrorText32A(UINT32 uError, LPSTR lpText, UINT32 uSize)
 {
-	dprintf_info(mmsys, "midiOutGetErrorText\n");
+	TRACE(mmsys, "midiOutGetErrorText\n");
 	return midiGetErrorText(uError, lpText, uSize);
 }
 
@@ -1755,7 +1754,7 @@
 	LPSTR	xstr = HeapAlloc(GetProcessHeap(),0,uSize);
 	UINT32	ret;
 
-	dprintf_info(mmsys, "midiOutGetErrorText\n");
+	TRACE(mmsys, "midiOutGetErrorText\n");
 	ret = midiGetErrorText(uError, xstr, uSize);
 	lstrcpyAtoW(lpText,xstr);
 	HeapFree(GetProcessHeap(),0,xstr);
@@ -1766,7 +1765,7 @@
  */
 UINT16 WINAPI midiOutGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize)
 {
-        dprintf_info(mmsys, "midiOutGetErrorText\n");
+        TRACE(mmsys, "midiOutGetErrorText\n");
 	return midiGetErrorText(uError, lpText, uSize);
 }
 
@@ -1839,10 +1838,10 @@
 	DWORD	dwRet = 0;
 	BOOL32	bMapperFlg = FALSE;
 	if (lphMidiOut != NULL) *lphMidiOut = 0;
-	dprintf_info(mmsys, "midiOutOpen(%p, %d, %08lX, %08lX, %08lX);\n", 
+	TRACE(mmsys, "(%p, %d, %08lX, %08lX, %08lX);\n", 
 		lphMidiOut, uDeviceID, dwCallback, dwInstance, dwFlags);
 	if (uDeviceID == (UINT16)MIDI_MAPPER) {
-		dprintf_info(mmsys, "midiOutOpen	// MIDI_MAPPER mode requested !\n");
+		TRACE(mmsys, "MIDI_MAPPER mode requested !\n");
 		bMapperFlg = TRUE;
 		uDeviceID = 0;
 	}
@@ -1860,7 +1859,7 @@
 		if (dwRet == MMSYSERR_NOERROR) break;
 		if (!bMapperFlg) break;
 		uDeviceID++;
-		dprintf_info(mmsys, "midiOutOpen	// MIDI_MAPPER mode ! try next driver...\n");
+		TRACE(mmsys, "MIDI_MAPPER mode ! try next driver...\n");
 	}
 	return dwRet;
 }
@@ -1879,7 +1878,7 @@
 UINT16 WINAPI midiOutClose16(HMIDIOUT16 hMidiOut)
 {
 	LPMIDIOPENDESC	lpDesc;
-	dprintf_info(mmsys, "midiOutClose(%04X)\n", hMidiOut);
+	TRACE(mmsys, "(%04X)\n", hMidiOut);
 	lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	return modMessage(0, MODM_CLOSE, lpDesc->dwInstance, 0L, 0L);
@@ -1901,7 +1900,7 @@
                                      MIDIHDR * lpMidiOutHdr, UINT16 uSize)
 {
 	LPMIDIOPENDESC	lpDesc;
-	dprintf_info(mmsys, "midiOutPrepareHeader(%04X, %p, %d)\n", 
+	TRACE(mmsys, "(%04X, %p, %d)\n", 
 					hMidiOut, lpMidiOutHdr, uSize);
 	lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -1924,7 +1923,7 @@
                                      MIDIHDR * lpMidiOutHdr, UINT16 uSize)
 {
 	LPMIDIOPENDESC	lpDesc;
-	dprintf_info(mmsys, "midiOutUnprepareHeader(%04X, %p, %d)\n", 
+	TRACE(mmsys, "(%04X, %p, %d)\n", 
 					hMidiOut, lpMidiOutHdr, uSize);
 	lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -1945,7 +1944,7 @@
 UINT16 WINAPI midiOutShortMsg16(HMIDIOUT16 hMidiOut, DWORD dwMsg)
 {
 	LPMIDIOPENDESC	lpDesc;
-	dprintf_info(mmsys, "midiOutShortMsg(%04X, %08lX)\n", hMidiOut, dwMsg);
+	TRACE(mmsys, "(%04X, %08lX)\n", hMidiOut, dwMsg);
 	lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	return modMessage(0, MODM_DATA, lpDesc->dwInstance, dwMsg, 0L);
@@ -1967,7 +1966,7 @@
                                MIDIHDR * lpMidiOutHdr, UINT16 uSize)
 {
 	LPMIDIOPENDESC	lpDesc;
-	dprintf_info(mmsys, "midiOutLongMsg(%04X, %p, %d)\n", 
+	TRACE(mmsys, "(%04X, %p, %d)\n", 
 				hMidiOut, lpMidiOutHdr, uSize);
 	lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -1989,7 +1988,7 @@
 UINT16 WINAPI midiOutReset16(HMIDIOUT16 hMidiOut)
 {
 	LPMIDIOPENDESC	lpDesc;
-	dprintf_info(mmsys, "midiOutReset(%04X)\n", hMidiOut);
+	TRACE(mmsys, "(%04X)\n", hMidiOut);
 	lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	return modMessage(0, MODM_RESET, lpDesc->dwInstance, 0L, 0L);
@@ -2007,7 +2006,7 @@
  */
 UINT16 WINAPI midiOutGetVolume16(UINT16 uDeviceID, DWORD * lpdwVolume)
 {
-	dprintf_info(mmsys, "midiOutGetVolume(%04X, %p);\n", uDeviceID, lpdwVolume);
+	TRACE(mmsys, "(%04X, %p);\n", uDeviceID, lpdwVolume);
 	return modMessage(uDeviceID, MODM_GETVOLUME, 0L, (DWORD)lpdwVolume, 0L);
 }
 
@@ -2024,7 +2023,7 @@
  */
 UINT16 WINAPI midiOutSetVolume16(UINT16 uDeviceID, DWORD dwVolume)
 {
-	dprintf_info(mmsys, "midiOutSetVolume(%04X, %08lX);\n", uDeviceID, dwVolume);
+	TRACE(mmsys, "(%04X, %08lX);\n", uDeviceID, dwVolume);
 	return modMessage(uDeviceID, MODM_SETVOLUME, 0L, dwVolume, 0L);
 }
 
@@ -2085,7 +2084,7 @@
  */
 UINT16 WINAPI midiOutGetID16(HMIDIOUT16 hMidiOut, UINT16 * lpuDeviceID)
 {
-	dprintf_info(mmsys, "midiOutGetID\n");
+	TRACE(mmsys, "midiOutGetID\n");
 	return 0;
 }
 
@@ -2097,7 +2096,7 @@
 {
 	LPMIDIOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "midiOutMessage(%04X, %04X, %08lX, %08lX)\n", 
+	TRACE(mmsys, "(%04X, %04X, %08lX, %08lX)\n", 
 			hMidiOut, uMessage, dwParam1, dwParam2);
 	lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -2134,7 +2133,7 @@
 {
 	LPMIDIOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "midiOutMessage(%04X, %04X, %08lX, %08lX)\n", 
+	TRACE(mmsys, "(%04X, %04X, %08lX, %08lX)\n", 
 			hMidiOut, uMessage, dwParam1, dwParam2);
 	lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -2179,9 +2178,9 @@
 UINT16 WINAPI midiInGetNumDevs16(void)
 {
 	UINT16	count = 0;
-	dprintf_info(mmsys, "midiInGetNumDevs\n");
+	TRACE(mmsys, "midiInGetNumDevs\n");
 	count += midMessage(0, MIDM_GETNUMDEVS, 0L, 0L, 0L);
-	dprintf_info(mmsys, "midiInGetNumDevs return %u \n", count);
+	TRACE(mmsys, "midiInGetNumDevs return %u \n", count);
 	return count;
 }
 
@@ -2225,7 +2224,7 @@
 UINT16 WINAPI midiInGetDevCaps16(UINT16 uDeviceID,
                                LPMIDIINCAPS16 lpCaps, UINT16 uSize)
 {
-	dprintf_info(mmsys, "midiInGetDevCaps\n");
+	TRACE(mmsys, "midiInGetDevCaps\n");
 	return midMessage(uDeviceID,MIDM_GETDEVCAPS,0,(DWORD)lpCaps,uSize);;
 }
 
@@ -2253,7 +2252,7 @@
  */
 UINT16 WINAPI midiInGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize)
 {
-	dprintf_info(mmsys, "midiInGetErrorText\n");
+	TRACE(mmsys, "midiInGetErrorText\n");
 	return (midiGetErrorText(uError, lpText, uSize));
 }
 
@@ -2281,10 +2280,10 @@
 	BOOL32	bMapperFlg = FALSE;
 
 	if (lphMidiIn != NULL) *lphMidiIn = 0;
-	dprintf_info(mmsys, "midiInOpen(%p, %d, %08lX, %08lX, %08lX);\n", 
+	TRACE(mmsys, "(%p, %d, %08lX, %08lX, %08lX);\n", 
 		lphMidiIn, uDeviceID, dwCallback, dwInstance, dwFlags);
 	if (uDeviceID == (UINT16)MIDI_MAPPER) {
-		dprintf_info(mmsys, "midiInOpen	// MIDI_MAPPER mode requested !\n");
+		TRACE(mmsys, "MIDI_MAPPER mode requested !\n");
 		bMapperFlg = TRUE;
 		uDeviceID = 0;
 	}
@@ -2301,7 +2300,7 @@
 		if (dwRet == MMSYSERR_NOERROR) break;
 		if (!bMapperFlg) break;
 		uDeviceID++;
-		dprintf_info(mmsys, "midiInOpen	// MIDI_MAPPER mode ! try next driver...\n");
+		TRACE(mmsys, "MIDI_MAPPER mode ! try next driver...\n");
 	}
 	return dwRet;
 }
@@ -2320,7 +2319,7 @@
 UINT16 WINAPI midiInClose16(HMIDIIN16 hMidiIn)
 {
 	LPMIDIOPENDESC	lpDesc;
-	dprintf_info(mmsys, "midiInClose(%04X)\n", hMidiIn);
+	TRACE(mmsys, "(%04X)\n", hMidiIn);
 	lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	return midMessage(0, MIDM_CLOSE, lpDesc->dwInstance, 0L, 0L);
@@ -2342,7 +2341,7 @@
                                     MIDIHDR * lpMidiInHdr, UINT16 uSize)
 {
 	LPMIDIOPENDESC	lpDesc;
-	dprintf_info(mmsys, "midiInPrepareHeader(%04X, %p, %d)\n", 
+	TRACE(mmsys, "(%04X, %p, %d)\n", 
 					hMidiIn, lpMidiInHdr, uSize);
 	lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -2366,7 +2365,7 @@
                                       MIDIHDR * lpMidiInHdr, UINT16 uSize)
 {
 	LPMIDIOPENDESC	lpDesc;
-	dprintf_info(mmsys, "midiInUnprepareHeader(%04X, %p, %d)\n", 
+	TRACE(mmsys, "(%04X, %p, %d)\n", 
 					hMidiIn, lpMidiInHdr, uSize);
 	lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -2389,7 +2388,7 @@
 UINT16 WINAPI midiInAddBuffer16(HMIDIIN16 hMidiIn,
                                 MIDIHDR * lpMidiInHdr, UINT16 uSize)
 {
-	dprintf_info(mmsys, "midiInAddBuffer\n");
+	TRACE(mmsys, "midiInAddBuffer\n");
 	return 0;
 }
 
@@ -2406,7 +2405,7 @@
  */
 UINT16 WINAPI midiInStart16(HMIDIIN16 hMidiIn)
 {
-	dprintf_info(mmsys, "midiInStart\n");
+	TRACE(mmsys, "midiInStart\n");
 	return 0;
 }
 
@@ -2423,7 +2422,7 @@
  */
 UINT16 WINAPI midiInStop16(HMIDIIN16 hMidiIn)
 {
-	dprintf_info(mmsys, "midiInStop\n");
+	TRACE(mmsys, "midiInStop\n");
 	return 0;
 }
 
@@ -2440,7 +2439,7 @@
  */
 UINT16 WINAPI midiInReset16(HMIDIIN16 hMidiIn)
 {
-	dprintf_info(mmsys, "midiInReset\n");
+	TRACE(mmsys, "midiInReset\n");
 	return 0;
 }
 
@@ -2449,7 +2448,7 @@
  */
 UINT32 WINAPI midiInGetID32(HMIDIIN32 hMidiIn, UINT32 * lpuDeviceID)
 {
-	dprintf_info(mmsys, "midiInGetID\n");
+	TRACE(mmsys, "midiInGetID\n");
 	return 0;
 }
 
@@ -2458,7 +2457,7 @@
  */
 UINT16 WINAPI midiInGetID16(HMIDIIN16 hMidiIn, UINT16 * lpuDeviceID)
 {
-	dprintf_info(mmsys, "midiInGetID\n");
+	TRACE(mmsys, "midiInGetID\n");
 	return 0;
 }
 
@@ -2469,7 +2468,7 @@
                              DWORD dwParam1, DWORD dwParam2)
 {
 	LPMIDIOPENDESC	lpDesc;
-	dprintf_info(mmsys, "midiInMessage(%04X, %04X, %08lX, %08lX)\n", 
+	TRACE(mmsys, "(%04X, %04X, %08lX, %08lX)\n", 
 			hMidiIn, uMessage, dwParam1, dwParam2);
 	lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -2508,7 +2507,7 @@
                              DWORD dwParam1, DWORD dwParam2)
 {
 	LPMIDIOPENDESC	lpDesc;
-	dprintf_info(mmsys, "midiInMessage(%04X, %04X, %08lX, %08lX)\n", 
+	TRACE(mmsys, "(%04X, %04X, %08lX, %08lX)\n", 
 			hMidiIn, uMessage, dwParam1, dwParam2);
 	lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -2554,9 +2553,9 @@
 UINT16 WINAPI waveOutGetNumDevs16()
 {
 	UINT16	count = 0;
-	dprintf_info(mmsys, "waveOutGetNumDevs\n");
+	TRACE(mmsys, "waveOutGetNumDevs\n");
 	count += wodMessage( MMSYSTEM_FirstDevID(), WODM_GETNUMDEVS, 0L, 0L, 0L);
-	dprintf_info(mmsys, "waveOutGetNumDevs return %u \n", count);
+	TRACE(mmsys, "waveOutGetNumDevs return %u \n", count);
 	return count;
 }
 
@@ -2568,7 +2567,7 @@
 {
 	if (uDeviceID > waveOutGetNumDevs16() - 1) return MMSYSERR_BADDEVICEID;
 	if (uDeviceID == (UINT16)WAVE_MAPPER) return MMSYSERR_BADDEVICEID; /* FIXME: do we have a wave mapper ? */
-	dprintf_info(mmsys, "waveOutGetDevCaps\n");
+	TRACE(mmsys, "waveOutGetDevCaps\n");
 	return wodMessage(uDeviceID, WODM_GETDEVCAPS, 0L, (DWORD)lpCaps, uSize);
 }
 
@@ -2615,7 +2614,7 @@
  */
 UINT16 WINAPI waveOutGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize)
 {
-	dprintf_info(mmsys, "waveOutGetErrorText\n");
+	TRACE(mmsys, "waveOutGetErrorText\n");
 	return(waveGetErrorText(uError, lpText, uSize));
 }
 
@@ -2647,7 +2646,7 @@
 static UINT16 waveGetErrorText(UINT16 uError, LPSTR lpText, UINT16 uSize)
 {
 	LPSTR	msgptr;
-	dprintf_info(mmsys, "waveGetErrorText(%04X, %p, %d);\n", 
+	TRACE(mmsys, "(%04X, %p, %d);\n", 
 	       uError, lpText, uSize);
 	if ((lpText == NULL) || (uSize < 1)) return(FALSE);
 	lpText[0] = '\0';
@@ -2733,12 +2732,12 @@
 	DWORD		dwRet = 0;
 	BOOL32		bMapperFlg = FALSE;
 
-	dprintf_info(mmsys, "waveOutOpen(%p, %d, %p, %08lX, %08lX, %08lX);\n", 
+	TRACE(mmsys, "(%p, %d, %p, %08lX, %08lX, %08lX);\n", 
 		lphWaveOut, uDeviceID, lpFormat, dwCallback, dwInstance, dwFlags);
 	if (dwFlags & WAVE_FORMAT_QUERY)
-		dprintf_info(mmsys, "waveOutOpen	// WAVE_FORMAT_QUERY requested !\n");
+		TRACE(mmsys, "WAVE_FORMAT_QUERY requested !\n");
 	if (uDeviceID == (UINT16)WAVE_MAPPER) {
-		dprintf_info(mmsys, "waveOutOpen	// WAVE_MAPPER mode requested !\n");
+		TRACE(mmsys, "WAVE_MAPPER mode requested !\n");
 		bMapperFlg = TRUE;
 		uDeviceID = 0;
 	}
@@ -2760,11 +2759,11 @@
 		if (dwRet == MMSYSERR_NOERROR) break;
 		if (!bMapperFlg) break;
 		uDeviceID++;
-		dprintf_info(mmsys, "waveOutOpen	// WAVE_MAPPER mode ! try next driver...\n");
+		TRACE(mmsys, "WAVE_MAPPER mode ! try next driver...\n");
 	}
 	lpDesc->uDeviceID = uDeviceID;  /* save physical Device ID */
 	if (dwFlags & WAVE_FORMAT_QUERY) {
-		dprintf_info(mmsys, "waveOutOpen	// End of WAVE_FORMAT_QUERY !\n");
+		TRACE(mmsys, "End of WAVE_FORMAT_QUERY !\n");
 		dwRet = waveOutClose32(hWaveOut);
 	}
 	return dwRet;
@@ -2784,7 +2783,7 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveOutClose(%04X)\n", hWaveOut);
+	TRACE(mmsys, "(%04X)\n", hWaveOut);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	return wodMessage( lpDesc->uDeviceID, WODM_CLOSE, lpDesc->dwInstance, 0L, 0L);
@@ -2798,7 +2797,7 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveOutPrepareHeader(%04X, %p, %u);\n", 
+	TRACE(mmsys, "(%04X, %p, %u);\n", 
 					hWaveOut, lpWaveOutHdr, uSize);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -2815,7 +2814,7 @@
 	LPBYTE		saveddata = lpWaveOutHdr->lpData;
 	UINT16		ret;
 
-	dprintf_info(mmsys, "waveOutPrepareHeader(%04X, %p, %u);\n", 
+	TRACE(mmsys, "(%04X, %p, %u);\n", 
 					hWaveOut, lpWaveOutHdr, uSize);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -2834,7 +2833,7 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveOutUnprepareHeader(%04X, %p, %u);\n", 
+	TRACE(mmsys, "(%04X, %p, %u);\n", 
 						hWaveOut, lpWaveOutHdr, uSize);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -2851,7 +2850,7 @@
 	LPBYTE		saveddata = lpWaveOutHdr->lpData;
 	UINT16		ret;
 
-	dprintf_info(mmsys, "waveOutUnprepareHeader(%04X, %p, %u);\n", 
+	TRACE(mmsys, "(%04X, %p, %u);\n", 
 						hWaveOut, lpWaveOutHdr, uSize);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -2869,7 +2868,7 @@
                              UINT32 uSize)
 {
 	LPWAVEOPENDESC	lpDesc;
-	dprintf_info(mmsys, "waveOutWrite(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
+	TRACE(mmsys, "(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	lpWaveOutHdr->reserved = (DWORD)lpWaveOutHdr->lpData;
@@ -2884,7 +2883,7 @@
 	LPWAVEOPENDESC	lpDesc;
 	UINT16		ret;
 
-	dprintf_info(mmsys, "waveOutWrite(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
+	TRACE(mmsys, "(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	lpWaveOutHdr->reserved=(DWORD)lpWaveOutHdr->lpData;/*save original ptr*/
@@ -2909,7 +2908,7 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveOutPause(%04X)\n", hWaveOut);
+	TRACE(mmsys, "(%04X)\n", hWaveOut);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	return wodMessage( lpDesc->uDeviceID, WODM_PAUSE, lpDesc->dwInstance, 0L, 0L);
@@ -2929,7 +2928,7 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveOutRestart(%04X)\n", hWaveOut);
+	TRACE(mmsys, "(%04X)\n", hWaveOut);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	return wodMessage( lpDesc->uDeviceID, WODM_RESTART, lpDesc->dwInstance, 0L, 0L);
@@ -2949,7 +2948,7 @@
 UINT16 WINAPI waveOutReset16(HWAVEOUT16 hWaveOut)
 {
 	LPWAVEOPENDESC	lpDesc;
-	dprintf_info(mmsys, "waveOutReset(%04X)\n", hWaveOut);
+	TRACE(mmsys, "(%04X)\n", hWaveOut);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	return wodMessage( lpDesc->uDeviceID, WODM_RESET, lpDesc->dwInstance, 0L, 0L);
@@ -2962,7 +2961,10 @@
                                    UINT32 uSize)
 {
 	MMTIME16	mmt16;
-	UINT32 ret = waveOutGetPosition16(hWaveOut,&mmt16,sizeof(mmt16));
+	UINT32 ret;
+	
+	mmt16.wType = lpTime->wType;
+	ret = waveOutGetPosition16(hWaveOut,&mmt16,sizeof(mmt16));
 	MMSYSTEM_MMTIME16to32(lpTime,&mmt16);
 	return ret;
 }
@@ -2973,7 +2975,7 @@
                                    UINT16 uSize)
 {
 	LPWAVEOPENDESC	lpDesc;
-	dprintf_info(mmsys, "waveOutGetPosition(%04X, %p, %u);\n", hWaveOut, lpTime, uSize);
+	TRACE(mmsys, "(%04X, %p, %u);\n", hWaveOut, lpTime, uSize);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	return wodMessage( lpDesc->uDeviceID, WODM_GETPOS, lpDesc->dwInstance, 
@@ -2988,7 +2990,7 @@
 UINT16 WINAPI waveOut##xx##16(HWAVEOUT16 hWaveOut, atype x)		\
 {									\
 	LPWAVEOPENDESC	lpDesc;						\
-	dprintf_info(mmsys, "waveOut"#xx"(%04X, %08lx);\n", hWaveOut,(DWORD)x);\
+	TRACE(mmsys, "waveOut"#xx"(%04X, %08lx);\n", hWaveOut,(DWORD)x);\
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);		\
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;		\
 	return wodMessage(lpDesc->uDeviceID, WODM_##XX, lpDesc->dwInstance,\
@@ -3007,7 +3009,7 @@
 }									\
 UINT16 WINAPI waveOut##xx##16(UINT16 devid, atype x)			\
 {									\
-	dprintf_info(mmsys, "waveOut"#xx"(%04X, %08lx);\n", devid,(DWORD)x);	\
+	TRACE(mmsys, "waveOut"#xx"(%04X, %08lx);\n", devid,(DWORD)x);	\
 	return wodMessage(devid, WODM_##XX, 0L,	(DWORD)x, 0L);		\
 }
 	
@@ -3028,7 +3030,7 @@
  */
 UINT16 WINAPI waveOutBreakLoop16(HWAVEOUT16 hWaveOut)
 {
-	dprintf_info(mmsys, "waveOutBreakLoop(%04X)\n", hWaveOut);
+	TRACE(mmsys, "(%04X)\n", hWaveOut);
 	return MMSYSERR_INVALHANDLE;
 }
 
@@ -3038,7 +3040,7 @@
 UINT32 WINAPI waveOutGetID32(HWAVEOUT32 hWaveOut, UINT32 * lpuDeviceID)
 {
 	LPWAVEOPENDESC	lpDesc;
-	dprintf_info(mmsys, "waveOutGetID(%04X, %p);\n", hWaveOut, lpuDeviceID);
+	TRACE(mmsys, "(%04X, %p);\n", hWaveOut, lpuDeviceID);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE;
@@ -3051,7 +3053,7 @@
 UINT16 WINAPI waveOutGetID16(HWAVEOUT16 hWaveOut, UINT16 * lpuDeviceID)
 {
 	LPWAVEOPENDESC	lpDesc;
-	dprintf_info(mmsys, "waveOutGetID(%04X, %p);\n", hWaveOut, lpuDeviceID);
+	TRACE(mmsys, "(%04X, %p);\n", hWaveOut, lpuDeviceID);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE;
@@ -3165,9 +3167,9 @@
 UINT16 WINAPI waveInGetNumDevs16()
 {
 	UINT16	count = 0;
-	dprintf_info(mmsys, "waveInGetNumDevs\n");
+	TRACE(mmsys, "waveInGetNumDevs\n");
 	count += widMessage(0, WIDM_GETNUMDEVS, 0L, 0L, 0L);
-	dprintf_info(mmsys, "waveInGetNumDevs return %u \n", count);
+	TRACE(mmsys, "waveInGetNumDevs return %u \n", count);
 	return count;
 }
 
@@ -3209,7 +3211,7 @@
  */
 UINT16 WINAPI waveInGetDevCaps16(UINT16 uDeviceID, LPWAVEINCAPS16 lpCaps, UINT16 uSize)
 {
-	dprintf_info(mmsys, "waveInGetDevCaps\n");
+	TRACE(mmsys, "waveInGetDevCaps\n");
 	return widMessage(uDeviceID, WIDM_GETDEVCAPS, 0L, (DWORD)lpCaps, uSize);
 }
 
@@ -3218,7 +3220,7 @@
  */
 UINT32 WINAPI waveInGetErrorText32A(UINT32 uError, LPSTR lpText, UINT32 uSize)
 {
-   dprintf_info(mmsys, "waveInGetErrorText\n");
+   TRACE(mmsys, "waveInGetErrorText\n");
    return(waveGetErrorText(uError, lpText, uSize));
 }
 
@@ -3240,7 +3242,7 @@
  */
 UINT16 WINAPI waveInGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize)
 {
-   dprintf_info(mmsys, "waveInGetErrorText\n");
+   TRACE(mmsys, "waveInGetErrorText\n");
    return(waveGetErrorText(uError, lpText, uSize));
 }
 
@@ -3269,12 +3271,12 @@
 	LPWAVEOPENDESC	lpDesc;
 	DWORD	dwRet = 0;
 	BOOL32	bMapperFlg = FALSE;
-	dprintf_info(mmsys, "waveInOpen(%p, %d, %p, %08lX, %08lX, %08lX);\n", 
+	TRACE(mmsys, "(%p, %d, %p, %08lX, %08lX, %08lX);\n", 
 		lphWaveIn, uDeviceID, lpFormat, dwCallback, dwInstance, dwFlags);
 	if (dwFlags & WAVE_FORMAT_QUERY)
-		dprintf_info(mmsys, "waveInOpen // WAVE_FORMAT_QUERY requested !\n");
+		TRACE(mmsys, "WAVE_FORMAT_QUERY requested !\n");
 	if (uDeviceID == (UINT16)WAVE_MAPPER) {
-		dprintf_info(mmsys, "waveInOpen	// WAVE_MAPPER mode requested !\n");
+		TRACE(mmsys, "WAVE_MAPPER mode requested !\n");
 		bMapperFlg = TRUE;
 		uDeviceID = 0;
 	}
@@ -3293,11 +3295,11 @@
 		if (dwRet == MMSYSERR_NOERROR) break;
 		if (!bMapperFlg) break;
 		uDeviceID++;
-		dprintf_info(mmsys, "waveInOpen	// WAVE_MAPPER mode ! try next driver...\n");
+		TRACE(mmsys, "WAVE_MAPPER mode ! try next driver...\n");
 	}
 	lpDesc->uDeviceID = uDeviceID;
 	if (dwFlags & WAVE_FORMAT_QUERY) {
-		dprintf_info(mmsys, "waveInOpen	// End of WAVE_FORMAT_QUERY !\n");
+		TRACE(mmsys, "End of WAVE_FORMAT_QUERY !\n");
 		dwRet = waveInClose16(hWaveIn);
 	}
 	return dwRet;
@@ -3317,7 +3319,7 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveInClose(%04X)\n", hWaveIn);
+	TRACE(mmsys, "(%04X)\n", hWaveIn);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	return widMessage(lpDesc->uDeviceID, WIDM_CLOSE, lpDesc->dwInstance, 0L, 0L);
@@ -3331,7 +3333,7 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveInPrepareHeader(%04X, %p, %u);\n", 
+	TRACE(mmsys, "(%04X, %p, %u);\n", 
 					hWaveIn, lpWaveInHdr, uSize);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -3339,7 +3341,7 @@
 	lpWaveInHdr = lpWaveInHdr;
 	lpWaveInHdr->lpNext = NULL;
     	lpWaveInHdr->dwBytesRecorded = 0;
-	dprintf_info(mmsys, "waveInPrepareHeader // lpData=%p size=%lu \n", 
+	TRACE(mmsys, "lpData=%p size=%lu \n", 
 		lpWaveInHdr->lpData, lpWaveInHdr->dwBufferLength);
 	return widMessage(lpDesc->uDeviceID,WIDM_PREPARE,lpDesc->dwInstance, 
 			  (DWORD)lpWaveInHdr, uSize);
@@ -3354,7 +3356,7 @@
 	LPBYTE		saveddata = lpWaveInHdr->lpData;
 	UINT16		ret;
 
-	dprintf_info(mmsys, "waveInPrepareHeader(%04X, %p, %u);\n", 
+	TRACE(mmsys, "(%04X, %p, %u);\n", 
 					hWaveIn, lpWaveInHdr, uSize);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -3363,7 +3365,7 @@
 	lpWaveInHdr->lpNext = NULL;
     	lpWaveInHdr->dwBytesRecorded = 0;
 
-	dprintf_info(mmsys, "waveInPrepareHeader // lpData=%p size=%lu \n", 
+	TRACE(mmsys, "lpData=%p size=%lu \n", 
 		lpWaveInHdr->lpData, lpWaveInHdr->dwBufferLength);
 	lpWaveInHdr->lpData = PTR_SEG_TO_LIN(lpWaveInHdr->lpData);
 	ret = widMessage(lpDesc->uDeviceID,WIDM_PREPARE,lpDesc->dwInstance, 
@@ -3381,7 +3383,7 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveInUnprepareHeader(%04X, %p, %u);\n", 
+	TRACE(mmsys, "(%04X, %p, %u);\n", 
 						hWaveIn, lpWaveInHdr, uSize);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -3400,7 +3402,7 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveInUnprepareHeader(%04X, %p, %u);\n", 
+	TRACE(mmsys, "(%04X, %p, %u);\n", 
 						hWaveIn, lpWaveInHdr, uSize);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -3420,13 +3422,13 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveInAddBuffer(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize);
+	TRACE(mmsys, "(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	if (lpWaveInHdr == NULL) return MMSYSERR_INVALHANDLE;
 	lpWaveInHdr->lpNext = NULL;
 	lpWaveInHdr->dwBytesRecorded = 0;
-	dprintf_info(mmsys, "waveInAddBuffer // lpData=%p size=%lu \n", 
+	TRACE(mmsys, "lpData=%p size=%lu \n", 
 		lpWaveInHdr->lpData, lpWaveInHdr->dwBufferLength);
 	return widMessage(lpDesc->uDeviceID, WIDM_ADDBUFFER, lpDesc->dwInstance,
 								(DWORD)lpWaveInHdr, uSize);
@@ -3442,14 +3444,14 @@
 	LPWAVEOPENDESC	lpDesc;
 	UINT16		ret;
 
-	dprintf_info(mmsys, "waveInAddBuffer(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize);
+	TRACE(mmsys, "(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	if (lpWaveInHdr == NULL) return MMSYSERR_INVALHANDLE;
 	lpWaveInHdr->lpNext = NULL;
 	lpWaveInHdr->dwBytesRecorded = 0;
 	lpWaveInHdr->lpData = PTR_SEG_TO_LIN(lpWaveInHdr->lpData);
-	dprintf_info(mmsys, "waveInAddBuffer // lpData=%p size=%lu \n", 
+	TRACE(mmsys, "lpData=%p size=%lu \n", 
 		lpWaveInHdr->lpData, lpWaveInHdr->dwBufferLength);
 	ret = widMessage(lpDesc->uDeviceID, WIDM_ADDBUFFER, lpDesc->dwInstance,
 			  (DWORD)lpWaveInHdr, uSize);
@@ -3472,7 +3474,7 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveInStart(%04X)\n", hWaveIn);
+	TRACE(mmsys, "(%04X)\n", hWaveIn);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	return widMessage(lpDesc->uDeviceID,WIDM_START,lpDesc->dwInstance,0,0);
@@ -3493,7 +3495,7 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveInStop(%04X)\n", hWaveIn);
+	TRACE(mmsys, "(%04X)\n", hWaveIn);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	return widMessage(lpDesc->uDeviceID, WIDM_STOP, lpDesc->dwInstance, 0L, 0L);
@@ -3514,7 +3516,7 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveInReset(%04X)\n", hWaveIn);
+	TRACE(mmsys, "(%04X)\n", hWaveIn);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	return widMessage(lpDesc->uDeviceID,WIDM_RESET,lpDesc->dwInstance,0,0);
@@ -3541,7 +3543,7 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveInGetPosition(%04X, %p, %u);\n", hWaveIn, lpTime, uSize);
+	TRACE(mmsys, "(%04X, %p, %u);\n", hWaveIn, lpTime, uSize);
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
 	return widMessage(lpDesc->uDeviceID, WIDM_GETPOS, lpDesc->dwInstance,
@@ -3555,7 +3557,7 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveInGetID\n");
+	TRACE(mmsys, "waveInGetID\n");
 	if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE;
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -3571,7 +3573,7 @@
 {
 	LPWAVEOPENDESC	lpDesc;
 
-	dprintf_info(mmsys, "waveInGetID\n");
+	TRACE(mmsys, "waveInGetID\n");
 	if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE;
 	lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
 	if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@@ -3663,7 +3665,7 @@
 */
 HDRVR16 WINAPI DrvOpen(LPSTR lpDriverName, LPSTR lpSectionName, LPARAM lParam)
 {
-	dprintf_info(mmsys, "DrvOpen('%s', '%s', %08lX);\n",
+	TRACE(mmsys, "('%s', '%s', %08lX);\n",
 		lpDriverName, lpSectionName, lParam);
 	return OpenDriver(lpDriverName, lpSectionName, lParam);
 }
@@ -3674,7 +3676,7 @@
 */
 LRESULT WINAPI DrvClose(HDRVR16 hDrvr, LPARAM lParam1, LPARAM lParam2)
 {
-	dprintf_info(mmsys, "DrvClose(%04X, %08lX, %08lX);\n", hDrvr, lParam1, lParam2);
+	TRACE(mmsys, "(%04X, %08lX, %08lX);\n", hDrvr, lParam1, lParam2);
 	return CloseDriver(hDrvr, lParam1, lParam2);
 }
 
@@ -3686,7 +3688,7 @@
                               LPARAM lParam2)
 {
 	DWORD 	dwDriverID = 0;
-	dprintf_info(mmsys, "DrvSendMessage(%04X, %04X, %08lX, %08lX);\n",
+	TRACE(mmsys, "(%04X, %04X, %08lX, %08lX);\n",
 					hDriver, msg, lParam1, lParam2);
 	return CDAUDIO_DriverProc(dwDriverID, hDriver, msg, lParam1, lParam2);
 }
@@ -3696,7 +3698,7 @@
 */
 HANDLE16 WINAPI DrvGetModuleHandle(HDRVR16 hDrvr)
 {
-	dprintf_info(mmsys, "DrvGetModuleHandle(%04X);\n", hDrvr);
+	TRACE(mmsys, "(%04X);\n", hDrvr);
         return 0;
 }
 
diff --git a/multimedia/time.c b/multimedia/time.c
index 0e60234..1afcce4 100644
--- a/multimedia/time.c
+++ b/multimedia/time.c
@@ -22,6 +22,12 @@
 static MMTIME16 mmSysTimeMS;
 static MMTIME16 mmSysTimeSMPTE;
 
+/* this is used to avoid infinite loop in timeGetTime, because
+   of the faked multimedia timers, and will desappear as soon as
+   the timers are implemented correctly.
+ */
+static int time_called=0;
+
 typedef struct tagTIMERENTRY {
     UINT32	wDelay;
     UINT32	wResol;
@@ -40,10 +46,11 @@
 
 /*
  * FIXME
- * is this the minimum resolution ? 
+ * We're using "1" as the mininum resolution to the timer,
+ * as Windows 95 does, according to the docs. Maybe it should
+ * depend on the computers resources!
  */
-/*#define MMSYSTIME_MININTERVAL (33)*/
-#define MMSYSTIME_MININTERVAL (31)
+#define MMSYSTIME_MININTERVAL (1)
 #define MMSYSTIME_MAXINTERVAL (65535)
 
 
@@ -60,10 +67,10 @@
 	    lpTimer->wCurTime = lpTimer->wDelay;
 
 	    if (lpTimer->lpFunc != (FARPROC16) NULL) {
-		dprintf_info(mmtime, "MMSysTimeCallback // before CallBack16 !\n");
-		dprintf_info(mmtime, "MMSysTimeCallback // lpFunc=%p wTimerID=%04X dwUser=%08lX !\n",
+		TRACE(mmtime, "before CallBack16 !\n");
+		TRACE(mmtime, "lpFunc=%p wTimerID=%04X dwUser=%08lX !\n",
 			lpTimer->lpFunc, lpTimer->wTimerID, lpTimer->dwUser);
-		dprintf_info(mmtime, "MMSysTimeCallback // hInstance=%04X !\n", lpTimer->hInstance);
+		TRACE(mmtime, "hInstance=%04X !\n", lpTimer->hInstance);
 
 
 /*        - TimeProc callback that is called here is something strange, under Windows 3.1x it is called 
@@ -79,7 +86,7 @@
 						    lpTimer->dwUser,0,0
 			);
 
-		dprintf_info(mmtime, "MMSysTimeCallback // after CallBack16 !\n");
+		TRACE(mmtime, "after CallBack16 !\n");
 	    }
 	    if (lpTimer->wFlags & TIME_ONESHOT)
 		timeKillEvent32(lpTimer->wTimerID);
@@ -103,16 +110,16 @@
 	    lpTimer->wCurTime = lpTimer->wDelay;
 
 	    if (lpTimer->lpFunc != (FARPROC16) NULL) {
-		dprintf_info(mmtime, "MMSysTimeCallback // before CallBack16 !\n");
-		dprintf_info(mmtime, "MMSysTimeCallback // lpFunc=%p wTimerID=%04X dwUser=%08lX !\n",
+		TRACE(mmtime, "before CallBack16 !\n");
+		TRACE(mmtime, "lpFunc=%p wTimerID=%04X dwUser=%08lX !\n",
 			lpTimer->lpFunc, lpTimer->wTimerID, lpTimer->dwUser);
-		dprintf_info(mmtime, "MMSysTimeCallback // hInstance=%04X !\n", lpTimer->hInstance);
+		TRACE(mmtime, "hInstance=%04X !\n", lpTimer->hInstance);
 
 /* This is wrong (lpFunc is NULL all the time)
 
    	        lpFunc = MODULE_GetEntryPoint( lpTimer->hInstance,
                          MODULE_GetOrdinal(lpTimer->hInstance,"TimerCallBack" ));
-		dprintf_info(mmtime, "MMSysTimeCallback // lpFunc=%08lx !\n", lpFunc);
+		TRACE(mmtime, "lpFunc=%08lx !\n", lpFunc);
 */
 
 
@@ -129,7 +136,7 @@
 						    lpTimer->dwUser,0,0
 			);
 
-		dprintf_info(mmtime, "MMSysTimeCallback // after CallBack16 !\n");
+		TRACE(mmtime, "after CallBack16 !\n");
 		fflush(stdout);
 	    }
 	    if (lpTimer->wFlags & TIME_ONESHOT)
@@ -164,7 +171,7 @@
  */
 MMRESULT32 WINAPI timeGetSystemTime32(LPMMTIME32 lpTime, UINT32 wSize)
 {
-    dprintf_info(mmsys, "timeGetSystemTime32(%p, %u);\n", lpTime, wSize);
+    TRACE(mmsys, "(%p, %u);\n", lpTime, wSize);
     if (!mmTimeStarted)
 	StartMMTime();
     lpTime->wType = TIME_MS;
@@ -177,7 +184,7 @@
  */
 MMRESULT16 WINAPI timeGetSystemTime16(LPMMTIME16 lpTime, UINT16 wSize)
 {
-    dprintf_info(mmsys, "timeGetSystemTime16(%p, %u);\n", lpTime, wSize);
+    TRACE(mmsys, "(%p, %u);\n", lpTime, wSize);
     if (!mmTimeStarted)
 	StartMMTime();
     lpTime->wType = TIME_MS;
@@ -196,7 +203,7 @@
     LPTIMERENTRY lpNewTimer;
     LPTIMERENTRY lpTimer = lpTimerList;
 
-    dprintf_info(mmtime, "timeSetEvent32(%u, %u, %p, %08lX, %04X);\n",
+    TRACE(mmtime, "(%u, %u, %p, %08lX, %04X);\n",
 		  wDelay, wResol, lpFunc, dwUser, wFlags);
     if (!mmTimeStarted)
 	StartMMTime();
@@ -218,8 +225,8 @@
     lpNewTimer->lpFunc = (FARPROC16) lpFunc;
     lpNewTimer->iswin32 = 1;
     lpNewTimer->hInstance = GetTaskDS();
-	dprintf_info(mmtime, "timeSetEvent // hInstance=%04X !\n", lpNewTimer->hInstance);
-	dprintf_info(mmtime, "timeSetEvent // lpFunc=%p !\n", 
+	TRACE(mmtime, "hInstance=%04X !\n", lpNewTimer->hInstance);
+	TRACE(mmtime, "lpFunc=%p !\n", 
 				lpFunc);
     lpNewTimer->dwUser = dwUser;
     lpNewTimer->wFlags = wFlags;
@@ -236,7 +243,7 @@
     WORD wNewID = 0;
     LPTIMERENTRY lpNewTimer;
     LPTIMERENTRY lpTimer = lpTimerList;
-    dprintf_info(mmtime, "timeSetEvent(%u, %u, %p, %08lX, %04X);\n",
+    TRACE(mmtime, "(%u, %u, %p, %08lX, %04X);\n",
 		  wDelay, wResol, lpFunc, dwUser, wFlags);
     if (!mmTimeStarted)
 	StartMMTime();
@@ -258,8 +265,8 @@
     lpNewTimer->lpFunc = (FARPROC16) lpFunc;
     lpNewTimer->iswin32 = 0;
     lpNewTimer->hInstance = GetTaskDS();
-	dprintf_info(mmtime, "timeSetEvent // hInstance=%04X !\n", lpNewTimer->hInstance);
-	dprintf_info(mmtime, "timeSetEvent // PTR_SEG_TO_LIN(lpFunc)=%p !\n", 
+	TRACE(mmtime, "hInstance=%04X !\n", lpNewTimer->hInstance);
+	TRACE(mmtime, "(lpFunc)=%p !\n", 
 				PTR_SEG_TO_LIN(lpFunc));
     lpNewTimer->dwUser = dwUser;
     lpNewTimer->wFlags = wFlags;
@@ -297,7 +304,7 @@
  */
 MMRESULT32 WINAPI timeGetDevCaps32(LPTIMECAPS32 lpCaps,UINT32 wSize)
 {
-    dprintf_info(mmtime, "timeGetDevCaps(%p, %u) !\n", lpCaps, wSize);
+    TRACE(mmtime, "(%p, %u) !\n", lpCaps, wSize);
     if (!mmTimeStarted)
 	StartMMTime();
     lpCaps->wPeriodMin = MMSYSTIME_MININTERVAL;
@@ -310,7 +317,7 @@
  */
 MMRESULT16 WINAPI timeGetDevCaps16(LPTIMECAPS16 lpCaps, UINT16 wSize)
 {
-    dprintf_info(mmtime, "timeGetDevCaps(%p, %u) !\n", lpCaps, wSize);
+    TRACE(mmtime, "(%p, %u) !\n", lpCaps, wSize);
     if (!mmTimeStarted)
 	StartMMTime();
     lpCaps->wPeriodMin = MMSYSTIME_MININTERVAL;
@@ -323,7 +330,7 @@
  */
 MMRESULT32 WINAPI timeBeginPeriod32(UINT32 wPeriod)
 {
-    dprintf_info(mmtime, "timeBeginPeriod32(%u) !\n", wPeriod);
+    TRACE(mmtime, "(%u) !\n", wPeriod);
     if (!mmTimeStarted)
 	StartMMTime();
     if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) 
@@ -335,7 +342,7 @@
  */
 MMRESULT16 WINAPI timeBeginPeriod16(UINT16 wPeriod)
 {
-    dprintf_info(mmtime, "timeBeginPeriod(%u) !\n", wPeriod);
+    TRACE(mmtime, "(%u) !\n", wPeriod);
     if (!mmTimeStarted)
 	StartMMTime();
     if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) 
@@ -348,7 +355,7 @@
  */
 MMRESULT32 WINAPI timeEndPeriod32(UINT32 wPeriod)
 {
-    dprintf_info(mmtime, "timeEndPeriod(%u) !\n", wPeriod);
+    TRACE(mmtime, "(%u) !\n", wPeriod);
     if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) 
         return TIMERR_NOCANDO;
     return 0;
@@ -359,7 +366,7 @@
  */
 MMRESULT16 WINAPI timeEndPeriod16(UINT16 wPeriod)
 {
-    dprintf_info(mmtime, "timeEndPeriod(%u) !\n", wPeriod);
+    TRACE(mmtime, "(%u) !\n", wPeriod);
     if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) 
         return TIMERR_NOCANDO;
     return 0;
@@ -370,18 +377,36 @@
  */
 DWORD WINAPI timeGetTime()
 {
+  /* FIXME all this function should have to be is
+       long result;
+       struct timeval time;
+       dprintf_mmtime(stddeb, "timeGetTime(); !\n");
+       gettimeofday(&time, 0);
+       result = (((long)time.tv_sec * (long)1000) + ((long)time.tv_usec / (long)1000));
+
+     but the multimedia timers are not implemented correctly, so all the rest
+     is a workaround to fake them.
+       
+   */  
     static DWORD lasttick=0;
     DWORD	newtick;
 
-    dprintf_info(mmtime, "timeGetTime(); !\n");
+    TRACE(mmtime, "!\n");
     if (!mmTimeStarted)
 	StartMMTime();
     newtick = GetTickCount();
     mmSysTimeMS.u.ms+=newtick-lasttick; /* FIXME: faked timer */
     if (newtick!=lasttick)
+
+    if (!time_called) { /* to avoid infinite recursion if timeGetTime is called
+			   inside check_MMtimers
+			 */
+      time_called++;
     	check_MMtimers();
+      time_called--;
+    }    //check_MMtimers();
     lasttick = newtick;
-    dprintf_info(mmtime, "timeGetTime() // Time = %ld\n",mmSysTimeMS.u.ms);
+    TRACE(mmtime, "Time = %ld\n",mmSysTimeMS.u.ms);
 
 
     return mmSysTimeMS.u.ms;
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 );
diff --git a/ole/Makefile.in b/ole/Makefile.in
index 85e981a..bbe7198 100644
--- a/ole/Makefile.in
+++ b/ole/Makefile.in
@@ -9,12 +9,14 @@
 	compobj.c \
 	ifs.c \
 	folders.c \
+	moniker.c \
 	ole2.c \
 	ole2disp.c \
 	ole2nls.c \
 	olecli.c \
 	olesvr.c \
-	storage.c
+	storage.c \
+	typelib.c
 
 all: $(MODULE).o
 
diff --git a/ole/compobj.c b/ole/compobj.c
index 0484f78..19047fa 100644
--- a/ole/compobj.c
+++ b/ole/compobj.c
@@ -33,7 +33,7 @@
  */
 DWORD WINAPI CoBuildVersion()
 {
-    dprintf_info(ole,"CoBuildVersion()\n");
+    TRACE(ole,"(void)\n");
     return (rmm<<16)+rup;
 }
 
@@ -41,8 +41,9 @@
  *           CoInitialize	[COMPOBJ.2]
  * lpReserved is an IMalloc pointer in 16bit OLE.
  */
-HRESULT WINAPI CoInitialize16(LPMALLOC16 lpReserved)
-{
+HRESULT WINAPI CoInitialize16(
+	LPMALLOC16 lpReserved	/* [in] pointer to win16 malloc interface */
+) {
     currentMalloc16 = lpReserved;
     return S_OK;
 }
@@ -51,8 +52,9 @@
  *           CoInitialize	(OLE32.26)
  * lpReserved is an IMalloc pointer in 32bit OLE.
  */
-HRESULT WINAPI CoInitialize32(LPMALLOC32 lpReserved)
-{
+HRESULT WINAPI CoInitialize32(
+	LPMALLOC32 lpReserved	/* [in] pointer to win32 malloc interface */
+) {
     currentMalloc32 = lpReserved;
     return S_OK;
 }
@@ -62,14 +64,16 @@
  */
 void WINAPI CoUnitialize()
 {
-    dprintf_info(ole,"CoUnitialize()\n");
+    TRACE(ole,"(void)\n");
 }
 
 /***********************************************************************
  *           CoGetMalloc    [COMPOBJ.4]
  */
-HRESULT WINAPI CoGetMalloc16(DWORD dwMemContext, LPMALLOC16 * lpMalloc)
-{
+HRESULT WINAPI CoGetMalloc16(
+	DWORD dwMemContext,	/* [in] unknown */
+	LPMALLOC16 * lpMalloc	/* [out] current win16 malloc interface */
+) {
     if(!currentMalloc16)
 	currentMalloc16 = IMalloc16_Constructor();
     *lpMalloc = currentMalloc16;
@@ -79,8 +83,10 @@
 /***********************************************************************
  *           CoGetMalloc    (OLE32.4]
  */
-HRESULT WINAPI CoGetMalloc32(DWORD dwMemContext, LPMALLOC32 *lpMalloc)
-{
+HRESULT WINAPI CoGetMalloc32(
+	DWORD dwMemContext,	/* [in] unknown */
+	LPMALLOC32 *lpMalloc	/* [out] current win32 malloc interface */
+) {
     if(!currentMalloc32)
 	currentMalloc32 = IMalloc32_Constructor();
     *lpMalloc = currentMalloc32;
@@ -92,7 +98,7 @@
  */
 OLESTATUS WINAPI CoDisconnectObject( LPUNKNOWN lpUnk, DWORD reserved )
 {
-    dprintf_info(ole,"CoDisconnectObject:%p %lx\n",lpUnk,reserved);
+    TRACE(ole,"%p %lx\n",lpUnk,reserved);
     return S_OK;
 }
 
@@ -117,7 +123,7 @@
   int	i;
   BYTE table[256];
 
-  dprintf_info(ole,"ClsIDFromString() %s -> %p\n", idstr, id);
+  TRACE(ole,"%s -> %p\n", idstr, id);
 
   /* quick lookup table */
   memset(table, 0, 256);
@@ -213,7 +219,7 @@
     idstr[i] = toupper(idstr[i]);
   }
 
-  dprintf_info(ole,"StringFromClsID: %p->%s\n", id, idstr);
+  TRACE(ole,"%p->%s\n", id, idstr);
 
   return OLE_OK;
 }
@@ -265,6 +271,16 @@
 	return ret;
 }
 
+OLESTATUS WINAPI StringFromGUID2(
+	const CLSID *id, LPOLESTR16 idstr, INT16 max
+) {
+	char		buf[80];
+	OLESTATUS	ret = WINE_StringFromCLSID(id,buf);
+
+	if (!ret)
+		lstrcpyn32A(idstr,buf,max);
+	return ret;
+}
 
 /***********************************************************************
  *           CLSIDFromProgID [COMPOBJ.61]
@@ -393,8 +409,12 @@
 
 /***********************************************************************
  *           CoTaskMemAlloc (OLE32.43)
+ * RETURNS
+ *  pointer to newly allocated block
  */
-LPVOID WINAPI CoTaskMemAlloc(ULONG size) {
+LPVOID WINAPI CoTaskMemAlloc(
+	ULONG size	/* [in] size of memoryblock to be allocated */
+) {
     LPMALLOC32	lpmalloc;
     HRESULT	ret = CoGetMalloc32(0,&lpmalloc);
 
@@ -406,7 +426,9 @@
 /***********************************************************************
  *           CoTaskMemFree (OLE32.44)
  */
-VOID WINAPI CoTaskMemFree(LPVOID ptr) {
+VOID WINAPI CoTaskMemFree(
+	LPVOID ptr	/* [in] pointer to be freed */
+) {
     LPMALLOC32	lpmalloc;
     HRESULT	ret = CoGetMalloc32(0,&lpmalloc);
 
@@ -421,3 +443,15 @@
     fprintf(stderr,"CoInitializeWOW(0x%08lx,0x%08lx),stub!\n",x,y);
     return 0;
 }
+
+/***********************************************************************
+ *           CoLockObjectExternal (COMPOBJ.63)
+ */
+HRESULT WINAPI CoLockObjectExternal16(
+    LPUNKNOWN pUnk,		/* [in] object to be locked */
+    BOOL16 fLock,		/* [in] do lock */
+    BOOL16 fLastUnlockReleases	/* [in] ? */
+) {
+    fprintf(stderr,"CoLockObjectExternal(%p,%d,%d),stub!\n",pUnk,fLock,fLastUnlockReleases);
+    return S_OK;
+}
diff --git a/ole/ifs.c b/ole/ifs.c
index 8e6147b..6f24584 100644
--- a/ole/ifs.c
+++ b/ole/ifs.c
@@ -24,11 +24,11 @@
  * IUnknown
  */
 static ULONG WINAPI IUnknown_AddRef(LPUNKNOWN this) { 
-	dprintf_info(relay,"IUnknown(%p)->AddRef()\n",this);
+	TRACE(relay,"(%p)->AddRef()\n",this);
 	return ++(this->ref);
 }
 static ULONG WINAPI IUnknown_Release(LPUNKNOWN this) {
-	dprintf_info(relay,"IUnknown(%p)->Release()\n",this);
+	TRACE(relay,"(%p)->Release()\n",this);
 	if (!--(this->ref)) {
 		HeapFree(GetProcessHeap(),0,this);
 		return 0;
@@ -40,7 +40,7 @@
 	char	xrefiid[50];
 
 	WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
-	dprintf_info(relay,"IUnknown(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
+	TRACE(relay,"(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
 
 	if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) {
 		*obj = this;
@@ -70,12 +70,12 @@
  * IMalloc16
  */
 ULONG WINAPI IMalloc16_AddRef(LPMALLOC16 this) {
-	dprintf_info(relay,"IMalloc16(%p)->AddRef()\n",this);
+	TRACE(relay,"(%p)->AddRef()\n",this);
 	return 1; /* cannot be freed */
 }
 
 ULONG WINAPI IMalloc16_Release(LPMALLOC16 this) {
-	dprintf_info(relay,"IMalloc16(%p)->Release()\n",this);
+	TRACE(relay,"(%p)->Release()\n",this);
 	return 1; /* cannot be freed */
 }
 
@@ -83,7 +83,7 @@
 	char	xrefiid[50];
 
 	WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
-	dprintf_info(relay,"IMalloc16(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
+	TRACE(relay,"(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
 	if (	!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown)) ||
 		!memcmp(&IID_IMalloc,refiid,sizeof(IID_IMalloc))
 	) {
@@ -94,30 +94,30 @@
 }
 
 LPVOID WINAPI IMalloc16_Alloc(LPMALLOC16 this,DWORD cb) {
-	dprintf_info(relay,"IMalloc16(%p)->Alloc(%ld)\n",this,cb);
+	TRACE(relay,"(%p)->Alloc(%ld)\n",this,cb);
 	return (LPVOID)PTR_SEG_OFF_TO_SEGPTR(this->heap,LOCAL_Alloc(this->heap,0,cb));
 }
 
 LPVOID WINAPI IMalloc16_Realloc(LPMALLOC16 this,LPVOID pv,DWORD cb) {
-	dprintf_info(relay,"IMalloc16(%p)->Realloc(%p,%ld)\n",this,pv,cb);
+	TRACE(relay,"(%p)->Realloc(%p,%ld)\n",this,pv,cb);
 	return (LPVOID)PTR_SEG_OFF_TO_SEGPTR(this->heap,LOCAL_ReAlloc(this->heap,0,LOWORD(pv),cb));
 }
 VOID WINAPI IMalloc16_Free(LPMALLOC16 this,LPVOID pv) {
-	dprintf_info(relay,"IMalloc16(%p)->Free(%p)\n",this,pv);
+	TRACE(relay,"(%p)->Free(%p)\n",this,pv);
 	LOCAL_Free(this->heap,LOWORD(pv));
 }
 
 DWORD WINAPI IMalloc16_GetSize(LPMALLOC16 this,LPVOID pv) {
-	dprintf_info(relay,"IMalloc16(%p)->GetSize(%p)\n",this,pv);
+	TRACE(relay,"(%p)->GetSize(%p)\n",this,pv);
 	return LOCAL_Size(this->heap,LOWORD(pv));
 }
 
 INT16 WINAPI IMalloc16_DidAlloc(LPMALLOC16 this,LPVOID pv) {
-	dprintf_info(relay,"IMalloc16(%p)->DidAlloc(%p)\n",this,pv);
+	TRACE(relay,"(%p)->DidAlloc(%p)\n",this,pv);
 	return (INT16)-1;
 }
 LPVOID WINAPI IMalloc16_HeapMinimize(LPMALLOC16 this) {
-	dprintf_info(relay,"IMalloc16(%p)->HeapMinimize()\n",this);
+	TRACE(relay,"(%p)->HeapMinimize()\n",this);
 	return NULL;
 }
 
@@ -144,7 +144,8 @@
 	} else {
 		HMODULE16	hcomp = GetModuleHandle16("COMPOBJ");
 		if (!msegvt16) {
-			msegvt16 = SEGPTR_NEW(IMalloc16_VTable);
+			this->lpvtbl = msegvt16 = SEGPTR_NEW(IMalloc16_VTable);
+
 #define FN(x) this->lpvtbl->fn##x = (void*)WIN32_GetProcAddress16(hcomp,"IMalloc16_"#x);assert(this->lpvtbl->fn##x);
 			FN(QueryInterface)
 			FN(AddRef)
@@ -171,12 +172,12 @@
  * IMalloc32
  */
 static ULONG WINAPI IMalloc32_AddRef(LPMALLOC32 this) {
-	dprintf_info(relay,"IMalloc32(%p)->AddRef()\n",this);
+	TRACE(relay,"(%p)->AddRef()\n",this);
 	return 1; /* cannot be freed */
 }
 
 static ULONG WINAPI IMalloc32_Release(LPMALLOC32 this) {
-	dprintf_info(relay,"IMalloc32(%p)->Release()\n",this);
+	TRACE(relay,"(%p)->Release()\n",this);
 	return 1; /* cannot be freed */
 }
 
@@ -184,7 +185,7 @@
 	char	xrefiid[50];
 
 	WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
-	dprintf_info(relay,"IMalloc32(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
+	TRACE(relay,"(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
 	if (	!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown)) ||
 		!memcmp(&IID_IMalloc,refiid,sizeof(IID_IMalloc))
 	) {
@@ -195,30 +196,30 @@
 }
 
 static LPVOID WINAPI IMalloc32_Alloc(LPMALLOC32 this,DWORD cb) {
-	dprintf_info(relay,"IMalloc32(%p)->Alloc(%ld)\n",this,cb);
+	TRACE(relay,"(%p)->Alloc(%ld)\n",this,cb);
 	return HeapAlloc(GetProcessHeap(),0,cb);
 }
 
 static LPVOID WINAPI IMalloc32_Realloc(LPMALLOC32 this,LPVOID pv,DWORD cb) {
-	dprintf_info(relay,"IMalloc32(%p)->Realloc(%p,%ld)\n",this,pv,cb);
+	TRACE(relay,"(%p)->Realloc(%p,%ld)\n",this,pv,cb);
 	return HeapReAlloc(GetProcessHeap(),0,pv,cb);
 }
 static VOID WINAPI IMalloc32_Free(LPMALLOC32 this,LPVOID pv) {
-	dprintf_info(relay,"IMalloc32(%p)->Free(%p)\n",this,pv);
+	TRACE(relay,"(%p)->Free(%p)\n",this,pv);
 	HeapFree(GetProcessHeap(),0,pv);
 }
 
 static DWORD WINAPI IMalloc32_GetSize(LPMALLOC32 this,LPVOID pv) {
-	dprintf_info(relay,"IMalloc32(%p)->GetSize(%p)\n",this,pv);
+	TRACE(relay,"(%p)->GetSize(%p)\n",this,pv);
 	return HeapSize(GetProcessHeap(),0,pv);
 }
 
 static INT32 WINAPI IMalloc32_DidAlloc(LPMALLOC32 this,LPVOID pv) {
-	dprintf_info(relay,"IMalloc32(%p)->DidAlloc(%p)\n",this,pv);
+	TRACE(relay,"(%p)->DidAlloc(%p)\n",this,pv);
 	return -1;
 }
 static LPVOID WINAPI IMalloc32_HeapMinimize(LPMALLOC32 this) {
-	dprintf_info(relay,"IMalloc32(%p)->HeapMinimize()\n",this);
+	TRACE(relay,"(%p)->HeapMinimize()\n",this);
 	return NULL;
 }
 
@@ -246,7 +247,14 @@
 /****************************************************************************
  * API Functions
  */
-BOOL32 WINAPI IsValidInterface32(LPUNKNOWN punk) {
+/****************************************************************************
+ * 		IsValidInterface		(OLE32.78)
+ * RETURNS
+ *  True, if the passed pointer is a valid interface
+ */
+BOOL32 WINAPI IsValidInterface32(
+	LPUNKNOWN punk	/* [in] interface to be tested */
+) {
 	return !(
 		IsBadReadPtr32(punk,4)					||
 		IsBadReadPtr32(punk->lpvtbl,4)				||
diff --git a/ole/moniker.c b/ole/moniker.c
new file mode 100644
index 0000000..17365cd
--- /dev/null
+++ b/ole/moniker.c
@@ -0,0 +1,33 @@
+/*
+ *	Monikers
+ *
+ *	Copyright 1998	Marcus Meissner
+ */
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include "winerror.h"
+#include "ole.h"
+#include "ole2.h"
+#include "ldt.h"
+#include "heap.h"
+#include "compobj.h"
+#include "interfaces.h"
+#include "shlobj.h"
+#include "local.h"
+#include "module.h"
+#include "debug.h"
+
+/****************************************************************************
+ *		CreateFileMoniker	(OLE2.28)
+ */
+HRESULT WINAPI
+CreateFileMoniker16(
+	LPCOLESTR16 lpszPathName,	/* [in] pathname */
+	LPMONIKER * ppmk		/* [out] new moniker object */
+) {
+	fprintf(stderr,"CreateFileMoniker(%s,%p),stub!\n",lpszPathName,ppmk);
+	return E_FAIL;
+}
diff --git a/ole/ole2.c b/ole/ole2.c
index 8171ac4..d6e4232 100644
--- a/ole/ole2.c
+++ b/ole/ole2.c
@@ -4,10 +4,8 @@
  *	Copyright 1995	Martin von Loewis
  */
 
-/*	At the moment, these are only empty stubs.
- */
-
 #include "windows.h"
+#include "winerror.h"
 #include "ole2.h"
 #include "process.h"
 #include "debug.h"
@@ -17,7 +15,7 @@
  */
 DWORD WINAPI OleBuildVersion()
 {
-    dprintf_info(ole,"OleBuildVersion()\n");
+    TRACE(ole,"(void)\n");
     return (rmm<<16)+rup;
 }
 
@@ -26,7 +24,7 @@
  */
 HRESULT WINAPI OleInitialize(LPVOID reserved)
 {
-    dprintf_fixme(ole,"OleInitialize - stub\n");
+    FIXME(ole,"OleInitialize - stub\n");
     return S_OK;
 }
 
@@ -39,7 +37,7 @@
  */
 void WINAPI OleUninitialize(void)
 {
-    dprintf_fixme(ole,"OleUninitialize() - stub\n");
+    FIXME(ole,"stub\n");
 }
 
 /***********************************************************************
@@ -57,7 +55,7 @@
     LPMESSAGEFILTER lpMessageFilter,	/* Pointer to interface */
     LPMESSAGEFILTER *lplpMessageFilter	/* Indirect pointer to prior instance if non-NULL */
 ) {
-    dprintf_fixme(ole,"CoRegisterMessageFilter() - stub\n");
+    FIXME(ole,"stub\n");
     if (lplpMessageFilter) {
 	*lplpMessageFilter = NULL;
     }
@@ -71,3 +69,23 @@
         fprintf(stderr,"OleInitializeWOW(0x%08lx),stub!\n",x);
         return 0;
 }
+
+/***********************************************************************
+ *           GetRunningObjectTable (OLE2.30)
+ */
+HRESULT WINAPI GetRunningObjectTable16(DWORD reserved, LPVOID *pprot) {
+	fprintf(stderr,"GetRunningObjectTable(%ld,%p),stub!\n",reserved,pprot);
+	return E_FAIL;
+}
+
+/***********************************************************************
+ *           RegisterDragDrop (OLE2.35)
+ */
+HRESULT WINAPI RegisterDragDrop16(
+	HWND16 hwnd,
+	LPDROPTARGET pDropTarget
+) {
+	fprintf(stderr,"RegisterDragDrop(0x%04x,%p),stub!\n",hwnd,pDropTarget);
+	return S_OK;
+}
+
diff --git a/ole/ole2nls.c b/ole/ole2nls.c
index b61c78d..19d7a6a 100644
--- a/ole/ole2nls.c
+++ b/ole/ole2nls.c
@@ -262,7 +262,7 @@
 	char	*retString;
 	int	found,i;
 
-	dprintf_info(ole,"GetLocaleInfo32A(%8lX,%8lX,%p,%4X)\n",
+	TRACE(ole,"(%8lX,%8lX,%p,%4X)\n",
 			lcid,LCType,buf,len);
 
 	LCType &= ~(LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP);
@@ -568,7 +568,7 @@
 LOCVAL(LOCALE_SDATE,".")
 LOCVAL(LOCALE_STIME,":")
 LOCVAL(LOCALE_SSHORTDATE,"MM/dd/yy")
-LOCVAL(LOCALE_SLONGDATE,"ddd, d. MMMM yyyy")
+LOCVAL(LOCALE_SLONGDATE,"ddd, MMMM d\'th\', yyyy")
 LOCVAL(LOCALE_STIMEFORMAT, "h:mm:ss tt")
 LOCVAL(LOCALE_IDATE,"1")
 /*
@@ -1909,7 +1909,7 @@
 	WCHAR	buffer[200];
 	HKEY	xhkey;
 
-	dprintf_info(win32,"EnumSystemLocales32W(%p,%08lx)\n",
+	TRACE(win32,"(%p,%08lx)\n",
                       lpfnLocaleEnum,flags );
 	/* see if we can reuse the Win95 registry entries.... */
 	if (ERROR_SUCCESS==RegOpenKey32A(HKEY_LOCAL_MACHINE,"\\System\\CurrentControlSet\\control\\Nls\\Locale\\",&xhkey)) {
@@ -1952,7 +1952,7 @@
 	CHAR	buffer[200];
 	HKEY	xhkey;
 
-	dprintf_info(win32,"EnumSystemLocales32A(%p,%08lx)\n",
+	TRACE(win32,"(%p,%08lx)\n",
 		lpfnLocaleEnum,flags
 	);
 	if (ERROR_SUCCESS==RegOpenKey32A(HKEY_LOCAL_MACHINE,"\\System\\CurrentControlSet\\control\\Nls\\Locale\\",&xhkey)) {
@@ -2082,7 +2082,7 @@
 	int	i;
 	char	*buf;
 
-	dprintf_info(ver,"VerLanguageName(%d,%p,%d)\n",langid,langname,langnamelen);
+	TRACE(ver,"(%d,%p,%d)\n",langid,langname,langnamelen);
 	/* First, check \System\CurrentControlSet\control\Nls\Locale\<langid>
 	 * from the registry. 
 	 */
@@ -2141,7 +2141,7 @@
 ) {
 	int	i,len;
 
-	dprintf_info(string,"LCMapStringA(0x%04lx,0x%08lx,%s,%d,%p,%d)\n",
+	TRACE(string,"(0x%04lx,0x%08lx,%s,%d,%p,%d)\n",
 		lcid,mapflags,srcstr,srclen,dststr,dstlen);
 	if (!dstlen || !dststr) {
 		dststr = (LPSTR)srcstr;
@@ -2179,7 +2179,7 @@
 ) {
 	int	i,len;
 
-	dprintf_info(string,"LCMapStringW(0x%04lx,0x%08lx,%p,%d,%p,%d)\n",
+	TRACE(string,"(0x%04lx,0x%08lx,%p,%d,%p,%d)\n",
 		lcid,mapflags,srcstr,srclen,dststr,dstlen
 	);
 	if (!dstlen || !dststr) {
@@ -2210,26 +2210,245 @@
 	return len;
 }
 
-/* FIXME: these shouldn't be needed */
+/*****************************************************************
+ *
+ *  OLE_GetFormatA()
+ *  OLE_GetFormatW()
 
-static char *any_locale_days[] = 
-{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
+ This function implements stuff for GetDateFormat() and 
+ GetTimeFormat().
 
-static char *any_locale_months[] =
-{"zero", "Jan", "Feb", "Mar", "Apr", "May", "Jun", 
-         "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
+  d    single-digit (no leading zero) day (of month)
+  dd   two-digit day (of month)
+  ddd  short day-of-week name
+  dddd long day-of-week name
+  M    single-digit month
+  MM   two-digit month
+  MMM  short month name
+  MMMM full month name
+  y    two-digit year, no leading 0
+  yy   two-digit year
+  yyyy four-digit year
+  gg   era string
+  h    hours with no leading zero (12-hour)
+  hh   hours with full two digits
+  H    hours with no leading zero (24-hour)
+  HH   hours with full two digits
+  m    minutes with no leading zero
+  mm   minutes with full two digits
+  s    seconds with no leading zero
+  ss   seconds with full two digits
+  t    time marker (A or P)
+  tt   time marker (AM, PM)
+  ''   used to quote literal characters
+  ''   (within a quoted string) indicates a literal '
 
-typedef struct {
-    int inpos;   /* place in the input buffer */
-    int outpos;  /* place in the output buffer */
-    int count;   
-    int inquote; 
-    char type;
-  } PARSING_STATE;
+ These functions REQUIRE valid locale, date,  and format. 
+
+ */
+
+INT32 WINAPI OLE_GetFormatA(LCID locale,
+			    DWORD flags,
+			    LPSYSTEMTIME xtime,
+			    LPCSTR format, 
+			    LPSTR date, INT32 datelen)
+{
+   INT32 inpos, outpos;
+   int count, type, inquote, Overflow;
+  char buf[40];
+  int buflen;
+
+   const char * _dgfmt[] = { "%d", "%02d" };
+   const char ** dgfmt = _dgfmt - 1; 
+
+   /* report, for debugging */
+   TRACE(ole, "func(%8x,%8x, time(d=%d,h=%d,m=%d,s=%d), fmt:\'%s\' (at %p), %p (%9s), len=%ld)\n", locale, flags,
+		xtime->wDay, xtime->wHour, xtime->wMinute, xtime->wSecond,
+		format, format, date, date, datelen);
+  
+   /* initalize state variables and output buffer */
+   inpos = outpos = 0;
+   count = 0; inquote = 0; Overflow = 0;
+   type = '\0';
+   date[0] = buf[0] = '\0';
+      
+   for (inpos = 0;; inpos++) {
+      /* TRACE(ole, "STATE inpos=%2d outpos=%2d count=%d inquote=%d type=%c buf,date = %c,%c\n", inpos, outpos, count, inquote, type, buf[inpos], date[outpos]); */
+      if (inquote) {
+	 if (format[inpos] == '\'') {
+	    if (format[inpos+1] == '\'') {
+	       inpos += 1;
+	       date[outpos++] = '\'';
+	    } else {
+	       inquote = 0;
+	       continue; /* we did nothing to the output */
+	    }
+	 } else if (format[inpos] == '\0') {
+	    date[outpos++] = '\0';
+	    if (outpos > datelen) Overflow = 1;
+	    break;
+	 } else {
+	    date[outpos++] = format[inpos];
+	    if (outpos > datelen) {
+	       Overflow = 1;
+	       date[outpos-1] = '\0'; /* this is the last place where
+					 it's safe to write */
+	       break;
+	    }
+	 }
+      } else if (  (count && (format[inpos] != type))
+		   || count == 4
+		   || (count == 2 && strchr("ghHmst", type)) )
+       {
+	    if         (type == 'd') {
+	       if        (count == 4) {
+		  GetLocaleInfo32A(locale,
+				   LOCALE_SDAYNAME1
+				   + xtime->wDayOfWeek - 1,
+				   buf, sizeof(buf));
+	       } else if (count == 3) {
+			   GetLocaleInfo32A(locale, 
+					    LOCALE_SABBREVDAYNAME1 
+					    + xtime->wDayOfWeek - 1,
+					    buf, sizeof(buf));
+		      } else {
+		  sprintf(buf, dgfmt[count], xtime->wDay);
+	       }
+	    } else if (type == 'M') {
+	       if (count == 3) {
+		  GetLocaleInfo32A(locale, 
+				   LOCALE_SABBREVMONTHNAME1
+				   + xtime->wMonth - 1,
+				   buf, sizeof(buf));
+	       } else if (count == 4) {
+		  GetLocaleInfo32A(locale,
+				   LOCALE_SMONTHNAME1
+				   + xtime->wMonth - 1,
+				   buf, sizeof(buf));
+		 } else {
+		  sprintf(buf, dgfmt[count], xtime->wMonth);
+	       }
+	    } else if (type == 'y') {
+	       if (count == 4) {
+		      sprintf(buf, "%d", xtime->wYear);
+	       } else if (count == 3) {
+		  strcpy(buf, "yyy");
+		  WARN(ole,
+			      "unknown format,\
+c=%c, n=%d\n",  type, count);
+		 } else {
+		  sprintf(buf, dgfmt[count], xtime->wYear % 100);
+	       }
+	    } else if (type == 'g') {
+	       if        (count == 2) {
+		  FIXME(ole, "LOCALE_ICALENDARTYPE unimp.\n");
+		  strcpy(buf, "AD");
+	    } else {
+		  strcpy(buf, "g");
+		  WARN(ole,
+			       "unknown format, \
+c=%c, n=%d\n", type, count);
+	       }
+	    } else if (type == 'h') {
+	       /* gives us hours 1:00 -- 12:00 */
+	       sprintf(buf, dgfmt[count], (xtime->wHour-1)%12 +1);
+	    } else if (type == 'H') {
+	       /* 24-hour time */
+	       sprintf(buf, dgfmt[count], xtime->wHour);
+	    } else if (type == 'm') {
+	       sprintf(buf, dgfmt[count], xtime->wMinute);
+	    } else if (type == 's') {
+	       sprintf(buf, dgfmt[count], xtime->wSecond);
+	    } else if (type == 't') {
+	       if        (count == 1) {
+		  sprintf(buf, "%c", (xtime->wHour < 12) ? 'A' : 'P');
+	       } else if (count == 2) {
+		  /* sprintf(buf, "%s", (xtime->wHour < 12) ? "AM" : "PM"); */
+		  GetLocaleInfo32A(locale,
+				   (xtime->wHour<12) 
+				   ? LOCALE_S1159 : LOCALE_S2359,
+				   buf, sizeof(buf));
+	       }
+	    };
+
+	    /* we need to check the next char in the format string 
+	       again, no matter what happened */
+	    inpos--;
+	    
+	    /* add the contents of buf to the output */
+	    buflen = strlen(buf);
+	    if (outpos + buflen < datelen) {
+	       date[outpos] = '\0'; /* for strcat to hook onto */
+		 strcat(date, buf);
+	       outpos += buflen;
+	    } else {
+	       date[outpos] = '\0';
+	       strncat(date, buf, datelen - outpos);
+		 date[datelen - 1] = '\0';
+		 SetLastError(ERROR_INSUFFICIENT_BUFFER);
+	       WARN(ole, "insufficient buffer\n");
+		 return 0;
+	    }
+
+	    /* reset the variables we used to keep track of this item */
+	    count = 0;
+	    type = '\0';
+	 } else if (format[inpos] == '\0') {
+	    /* we can't check for this at the loop-head, because
+	       that breaks the printing of the last format-item */
+	    date[outpos] = '\0';
+	    break;
+         } else if (count) {
+	    /* continuing a code for an item */
+	    count +=1;
+	    continue;
+	 } else if (strchr("hHmstyMdg", format[inpos])) {
+	    type = format[inpos];
+	    count = 1;
+	    continue;
+	 } else if (format[inpos] == '\'') {
+	    inquote = 1;
+	    continue;
+       } else {
+	    date[outpos++] = format[inpos];
+	 }
+      /* now deal with a possible buffer overflow */
+      if (outpos >= datelen) {
+       date[datelen - 1] = '\0';
+       SetLastError(ERROR_INSUFFICIENT_BUFFER);
+       return 0;
+      }
+   }
+   
+   if (Overflow) {
+      SetLastError(ERROR_INSUFFICIENT_BUFFER);
+   };
+
+   /* finish it off with a string terminator */
+   outpos++;
+   /* sanity check */
+   if (outpos > datelen-1) outpos = datelen-1;
+   date[outpos] = '\0';
+   
+   TRACE(ole, "OLE_GetFormatA returns string '%s', len %d\n",
+	       date, outpos);
+   return outpos;
+}
+
+INT32 WINAPI OLE_GetFormatW(LCID locale, DWORD flags,
+			    LPSYSTEMTIME xtime,
+			    LPCWSTR format,
+			    LPWSTR timestr, INT32 timelen)
+{
+   FIXME(ole, "(unicode GetDateFormat) STUB\n");
+   return 0;
+   
+}
+
 
 /*****************************************************************
  *
- *  GetDateFormat()
+ *  GetDateFormat32A()
 
   This function uses format to format the date,  or,  if format
   is NULL, uses the default for the locale.  format is a string
@@ -2250,182 +2469,89 @@
 
  * ***********************/
 
-INT32 WINAPI GetDateFormat32A(LCID locale,DWORD flags,LPSYSTEMTIME xtime,
+INT32 WINAPI GetDateFormat32A(LCID locale,DWORD flags,
+			      LPSYSTEMTIME xtime,
 			      LPCSTR format, LPSTR date,INT32 datelen) 
 {
-  PARSING_STATE state;   
-  char buf[40];
-  int buflen;
+   
+  char format_buf[40];
   LPCSTR thisformat;
+  SYSTEMTIME t;
+  LPSYSTEMTIME thistime;
+  LCID thislocale;
 
-  dprintf_info(ole,"GetDateFormat(0x%04lx,0x%08lx,%p,%s,%p,%d)\n",
+  INT32 ret;
+
+  TRACE(ole,"(0x%04lx,0x%08lx,%p,%s,%p,%d)\n",
 	      locale,flags,xtime,format,date,datelen);
-
-  /* FIXME: Get the default for this locale */
-  if (format) {
-    thisformat = format;
+  
+  if (!locale) {
+     locale = LOCALE_SYSTEM_DEFAULT;
+     };
+  
+  if (locale == LOCALE_SYSTEM_DEFAULT) {
+     thislocale = GetSystemDefaultLCID();
+  } else if (locale == LOCALE_USER_DEFAULT) {
+     thislocale = GetUserDefaultLCID();
   } else {
-    thisformat = "yyyy-MM-dd (ddd) ";
+     thislocale = locale;
+   };
+
+  if (xtime == NULL) {
+     GetSystemTime(&t);
+     thistime = &t;
+  } else {
+     thistime = xtime;
+  };
+
+  if (format == NULL) {
+     GetLocaleInfo32A(thislocale, ((flags&DATE_LONGDATE) 
+				   ? LOCALE_SLONGDATE
+				   : LOCALE_SSHORTDATE),
+		      format_buf, sizeof(format_buf));
+     thisformat = format_buf;
+  } else {
+     thisformat = format;
   };
 
   
-  /* initialize state variables */
-  state.inpos = state.outpos = 0;
-  state.count = state.inquote = 0;
-  state.type = '\0';
-  /* initialise output buffer */
-  date[0] = '\0';
-      
-  for (state.inpos = 0; thisformat[state.inpos] ; state.inpos++) {
-       if (state.inquote) {
-	    if (thisformat[state.inpos] == '\'') {
-		 state.inquote = 0;
-		 continue;
-	    } else {
-		 date[state.outpos++] = thisformat[state.inpos];
-	    };	    
-       } else if ( (state.count && (thisformat[state.inpos] != state.type)) 
-		   || state.count == 4 
-		   || (state.count == 2 && state.type == 'g' ) ) 
-       {
-	    /* end of a format-type string */
-	    if         (state.type == 'd') {
-		 if        (state.count == 1) {
-		      sprintf(buf, "%d", xtime->wDay);
-		 } else if (state.count == 2) {
-		      sprintf(buf, "%02d", xtime->wDay);
-		 } else if (state.count == 3) {
-		      /* day of week, short */
-		      /* FIXME: This is the way to do it everywhere */
-		      if (locale) {
-			   
-			   GetLocaleInfo32A(locale, 
-					    LOCALE_SABBREVDAYNAME1 
-					    + xtime->wDayOfWeek - 1,
-					    buf, sizeof(buf));
-		      } else {
-			   strcpy(buf, 
-				  any_locale_days[xtime->wDayOfWeek -1]);
-		      };
-		 } else if (state.count == 4) {
-		      /* day of week, long */
+  ret = OLE_GetFormatA(thislocale, flags, thistime, thisformat, 
+		       date, datelen);
+  
 
-		      /* FIXME: get the days from the locale */
-		      /* FIXME: these should be long days */
-		      sprintf(buf, "%.*s", (int) sizeof(buf),
-			      any_locale_days[xtime->wDayOfWeek]);
-		 } else {
-		      dprintf_info(ole, 
-				  "GetDateFormat(): unbekannt format, \
-c=%c, n=%d\n",
-				  state.type, state.count);
-		 };
-	    } else if (state.type == 'M') {
-		 if        (state.count == 1) {
-		      sprintf(buf, "%d", xtime->wMonth);
-		 } else if (state.count == 2) {
-		      sprintf(buf, "%02d", xtime->wMonth);
-		 } else if (state.count == 3) {
-		      /* FIXME: get the month-name from the locale */
-		      sprintf(buf, "%.*s", (int) sizeof(buf),
-			      any_locale_months[xtime->wMonth]);
-		 } else if (state.count == 4) {
-		      /* FIXME: get the month-name from the locale */
-		      /* FIXME: should return a long month */
-		      sprintf(buf, "%.*s", (int) sizeof(buf), 
-			      any_locale_months[xtime->wMonth]);
-		 } else {
-		      dprintf_info(ole, 
-			  "GetDateFormat(): unbekannt format, c=%c, n=%d\n",
-				  state.type, state.count);
-		 };
-	    } else if (state.type == 'y') {
-		 if        (state.count == 1) {
-		      sprintf(buf, "%d", xtime->wYear % 100);
-		 } else if (state.count == 2) {
-		      sprintf(buf, "02%d", xtime->wYear % 100);
-		 } else if (state.count == 4) {
-		      sprintf(buf, "%d", xtime->wYear);
-		 } else {
-		      dprintf_info(ole, 
-			 "GetDateFormat(): unbekannt format, c=%c, n=%d\n",
-				  state.type, state.count);
-		 };
-	    } else if (state.type == 'g') {
-		 if        (state.count == 2) {
-		      /* FIXME: Get era from the locale */
-		      strcpy(buf, "AD (CE)");
-		 } else {
-		      dprintf_info(ole, 
-			 "GetDateFormat(): unbekannt format, c=%c, n=%d",
-				  state.type, state.count);
-		 };
-	    } else {
-		 dprintf_info(ole, 
-		     "GetDateFormat(): unbekannt format, c=%c, n=%d\n",
-			     state.type, state.count);
-	    };
-	    buflen = strlen(buf);
-
-	    /* we need to check the next char again, one
-	       way or another */
-	    state.inpos--;
-	    
-            /* now, add buf to the output buffer */
-	    if (state.outpos + buflen < datelen) {
-		 date[state.outpos] = '\0'; /* for strcat to hook on */
-		 strcat(date, buf);
-		 state.outpos += buflen;
-	    } else {
-		 date[state.outpos] = '\0';
-		 strncat(date, buf, datelen - state.outpos - 1);
-		 date[datelen - 1] = '\0';
-		 SetLastError(ERROR_INSUFFICIENT_BUFFER);
-		 return 0;
-	    };
-
-	    /* reset other variables */
-	    state.count = 0;
-	    state.type = '\0';
-
-	    /* end of code for printing format-strings */
-       } else if (state.count) {
-	    /* and char is of same type (see above) */
-	    state.count += 1;;
-       } else if (strchr("yMdg", thisformat[state.inpos])) {
-	    state.type = thisformat[state.inpos];
-	    state.count = 1;
-       } else if (thisformat[state.inpos] == '\'') {
-	    state.inquote = 1;
-       } else {
-	    date[state.outpos++] = thisformat[state.inpos];
-       };
-     if (state.outpos >= datelen) {
-       date[datelen - 1] = '\0';
-       SetLastError(ERROR_INSUFFICIENT_BUFFER);
-       return 0;
-     };
-   };
-
-  state.outpos++;
-  if (state.outpos >= datelen - 1) {
-       state.outpos = datelen - 1;
-  };
-
-  date[state.outpos] = '\0';
-
-   dprintf_info(ole, 
+   TRACE(ole, 
 	       "GetDateFormat32A() returning %d, with data=%s\n",
-	       state.outpos, date);
-   return state.outpos;
+	       ret, date);
+  return ret;
+}
+
+/* ****************************************************************
+ *  GetDateFormat32W()
+
+ * Acts the same as GetDateFormat32A(),  except that it's Unicode.
+ * Accepts & returns sizes as counts of Unicode characters.
+
+ */
+INT32 WINAPI GetDateFormat32W(LCID locale,DWORD flags,
+			      LPSYSTEMTIME xtime,
+			      LPCWSTR format,
+			      LPWSTR date, INT32 datelen)
+{
+   short datearr[] = {'1','9','9','4','-','1','-','1',0};
+
+   FIXME(ole, "STUB\n");   
+   lstrcpyn32W(date, datearr, datelen);
+   return (  datelen < 9) ? datelen : 9;
+   
+   
 }
 
 /*****************************************************************
  *
- * GetTimeFormat() 
+ * GetTimeFormat32A() 
 
- Formats date according to format,  or locale default if format is NULL.
- The format consists of literal characters and fields as follows:
+ Formats date according to format,  or locale default if format is
+ NULL. The format consists of literal characters and fields as follows:
 
  h  hours with no leading zero (12-hour)
  hh hours with full two digits
@@ -2440,23 +2566,66 @@
 
  */
 
-INT32 WINAPI GetTimeFormat32A(LCID locale,DWORD flags,LPSYSTEMTIME xtime,
-			      LPCSTR format, LPSTR timestr,INT32 timelen
-) {
-   dprintf_info(ole,"GetTimeFormat(0x%04lx,0x%08lx,%p,%s,%p,%d), stub\n",
+INT32 WINAPI GetTimeFormat32A(LCID locale,DWORD flags,
+			      LPSYSTEMTIME xtime,
+			      LPCSTR format, 
+			      LPSTR timestr,INT32 timelen) 
+{
+   INT32 ret;
+   LPCSTR realformat;
+   char fmt_buf[40];
+   
+   TRACE(ole,"GetTimeFormat(0x%04lx,0x%08lx,%p,%s,%p,%d)\n",
 		locale,flags,xtime,format,timestr,timelen
 	);
    
-   /* FIXME: implement this one.  Perhaps a common codebase? */
+   if (format) {
+      realformat = format;
+   } else if (locale) {
+      GetLocaleInfo32A(locale, LOCALE_STIMEFORMAT,
+		       fmt_buf,  sizeof(fmt_buf));
+      realformat = fmt_buf;
+   } else {
+      WARN(ole, "Caller gave no locale and no format\n");
+      realformat = "hh:mm:ss";
+   };
+   if (!locale) {
+      locale = GetSystemDefaultLCID();
+   }
 
 
+   return OLE_GetFormatA(locale, flags, xtime, realformat, timestr, timelen);
 
-
-
-	lstrcpyn32A(timestr,"00:00:42",timelen);
-	return strlen("00:00:42");
 }
 
+/* ****************************************************************
+ *  GetTimeFormat32W()
+ * 
+ *
+ */
+
+INT32 WINAPI GetTimeFormat32W(LCID locale,DWORD flags,
+			      LPSYSTEMTIME xtime,
+			      LPCWSTR format, 
+			      LPWSTR timestr,INT32 timelen) 
+{
+   char buf[40];
+   
+   lstrcpynWtoA(buf, format, (sizeof(buf))/2);
+   
+   TRACE(ole, "GetTimeFormatW len %d flags 0x%lX format >%s<\n",
+		timelen, flags, buf);
+   FIXME(ole, "STUB");
+   SetLastError(ERROR_INSUFFICIENT_BUFFER);
+   return 0;
+
+
+}
+
+
+
+
+
 
 
 
diff --git a/ole/olecli.c b/ole/olecli.c
index bc63ef1..e510951 100644
--- a/ole/olecli.c
+++ b/ole/olecli.c
@@ -106,14 +106,25 @@
 
 
 /***********************************************************************
- *           OleIsDcMeta
+ *           OleIsDcMeta16
  */
-BOOL16 WINAPI OleIsDcMeta(HDC16 hdc)
+BOOL16 WINAPI OleIsDcMeta16(HDC16 hdc)
 {
-	dprintf_info(ole,"OleIsDCMeta(%04x)\n",hdc);
+	TRACE(ole,"(%04x)\n",hdc);
 	return GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ) != 0;
 }
 
+
+/***********************************************************************
+ *           OleIsDcMeta32
+ */
+BOOL32 WINAPI OleIsDcMeta32(HDC32 hdc)
+{
+        TRACE(ole,"(%04x)\n",hdc);
+        return GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ) != 0;
+}
+
+
 /***********************************************************************
  *           OleSetHostNames
  */
diff --git a/ole/olesvr.c b/ole/olesvr.c
index 186475e..f604a4a 100644
--- a/ole/olesvr.c
+++ b/ole/olesvr.c
@@ -20,7 +20,7 @@
                                       LHSERVER *hRet, HINSTANCE16 hServer,
                                       OLE_SERVER_USE use )
 {
-    dprintf_fixme(ole,"OleRegisterServer:%s - stub\n",name);
+    FIXME(ole,"%s - stub\n",name);
     *hRet=++OLE_current_handle;
     /* return OLE_ERROR_MEMORY, OLE_ERROR_PROTECT_ONLY if you want it fail*/
     return OLE_OK;
@@ -73,7 +73,7 @@
                                          LPOLESERVERDOC document,
                                          LHSERVERDOC *hRet)
 {
-    dprintf_fixme(ole,"OleRegisterServerDoc:%ld,%s - stub\n", 
+    FIXME(ole,"%ld,%s - stub\n", 
 		hServer, docname);
     *hRet=++OLE_current_handle;
     return OLE_OK;
@@ -84,7 +84,7 @@
  */
 OLESTATUS WINAPI OleRevokeServerDoc16(LHSERVERDOC hServerDoc)
 {
-    dprintf_fixme(ole,"OleRevokeServerDoc:%ld  - stub\n",hServerDoc);
+    FIXME(ole,"%ld  - stub\n",hServerDoc);
     return OLE_OK;
 }
 
@@ -102,7 +102,7 @@
  */
 OLESTATUS WINAPI OleRevokeServer(LHSERVER hServer)
 {
-    dprintf_fixme(ole,"OleRevokeServer:%ld - stub\n",hServer);
+    FIXME(ole,"%ld - stub\n",hServer);
     return OLE_OK;
 }
 
diff --git a/ole/storage.c b/ole/storage.c
index 06d67a8..3377f79 100644
--- a/ole/storage.c
+++ b/ole/storage.c
@@ -586,7 +586,7 @@
 	char    xrefiid[50];
 
 	WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
-	dprintf_info(relay,"IStream16(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
+	TRACE(relay,"(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
 	if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) {
 		*obj = this;
 		return 0;
@@ -614,7 +614,7 @@
 HRESULT WINAPI IStream16_Seek(
 	LPSTREAM16 this,LARGE_INTEGER offset,DWORD whence,ULARGE_INTEGER *newpos
 ) {
-	dprintf_info(relay,"IStream16(%p)->Seek([%ld.%ld],%ld,%p)\n",this,offset.HighPart,offset.LowPart,whence,newpos);
+	TRACE(relay,"(%p)->Seek([%ld.%ld],%ld,%p)\n",this,offset.HighPart,offset.LowPart,whence,newpos);
 
 	switch (whence) {
 	/* unix SEEK_xx should be the same as win95 ones */
@@ -658,7 +658,7 @@
 	ULONG	*bytesread=pcbRead,xxread;
 	int	blocknr;
 
-	dprintf_info(relay,"IStream16(%p)->Read(%p,%ld,%p)\n",this,pv,cb,pcbRead);
+	TRACE(relay,"(%p)->Read(%p,%ld,%p)\n",this,pv,cb,pcbRead);
 	if (!pcbRead) bytesread=&xxread;
 	*bytesread = 0;
 
@@ -719,7 +719,7 @@
 	if (!pcbWrite) byteswritten=&xxwritten;
 	*byteswritten = 0;
 
-	dprintf_info(relay,"IStream16(%p)->Write(%p,%ld,%p)\n",this,pv,cb,pcbWrite);
+	TRACE(relay,"(%p)->Write(%p,%ld,%p)\n",this,pv,cb,pcbWrite);
 	/* do we need to junk some blocks? */
 	newsize	= this->offset.LowPart+cb;
 	oldsize	= this->stde.pps_size;
@@ -1029,7 +1029,7 @@
 	char    xrefiid[50];
 
 	WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
-	dprintf_info(relay,"IStream16(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
+	TRACE(relay,"(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
 	if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) {
 		*obj = this;
 		return 0;
@@ -1076,7 +1076,7 @@
 	char    xrefiid[50];
 
 	WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
-	dprintf_info(relay,"IStorage16(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
+	TRACE(relay,"(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
 
 	if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) {
 		*obj = this;
@@ -1252,7 +1252,7 @@
 	WCHAR		name[33];
 	int		newpps;
 
-	dprintf_info(relay,"IStorage16(%p)->OpenStorage(%s,%p,0x%08lx,%p,0x%08lx,%p)\n",
+	TRACE(relay,"(%p)->OpenStorage(%s,%p,0x%08lx,%p,0x%08lx,%p)\n",
 		this,pwcsName,pstgPrio,grfMode,snbExclude,reserved,ppstg
 	);
 	if (grfMode & STGM_TRANSACTED)
@@ -1282,7 +1282,7 @@
 	WCHAR		name[33];
 	int		newpps;
 
-	dprintf_info(relay,"IStorage16(%p)->OpenStream(%s,%p,0x%08lx,0x%08lx,%p)\n",
+	TRACE(relay,"(%p)->OpenStream(%s,%p,0x%08lx,0x%08lx,%p)\n",
 		this,pwcsName,reserved1,grfMode,reserved2,ppstm
 	);
 	if (grfMode & STGM_TRANSACTED)
@@ -1378,7 +1378,7 @@
 	char    xrefiid[50];
 
 	WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
-	dprintf_info(relay,"IStorage32(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
+	TRACE(relay,"(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
 
 	if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) {
 		*obj = this;
diff --git a/ole/typelib.c b/ole/typelib.c
new file mode 100644
index 0000000..16cd72c
--- /dev/null
+++ b/ole/typelib.c
@@ -0,0 +1,31 @@
+/*
+ *	TYPELIB
+ *
+ *	Copyright 1997	Marcus Meissner
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include "wintypes.h"
+#include "windows.h"
+#include "winerror.h"
+#include "ole.h"
+#include "ole2.h"
+#include "compobj.h"
+#include "debug.h"
+
+HRESULT WINAPI
+QueryPathOfRegTypeLib(REFGUID guid,WORD wMaj, WORD wMin, LCID lcid,LPSTR path) 
+{
+	char	xguid[80];
+
+	if (HIWORD(guid))
+		WINE_StringFromCLSID(guid,xguid);
+	else
+		sprintf(xguid,"<guid 0x%08lx>",guid);
+	fprintf(stderr,"QueryPathOfRegTypeLib(%s,%d,%d,0x%04x,%p),stub!\n",
+		xguid,wMaj,wMin,lcid,path
+	);
+	return E_FAIL;
+}
diff --git a/programs/clock/ChangeLog b/programs/clock/ChangeLog
index ce10b4f..5d9c791 100644
--- a/programs/clock/ChangeLog
+++ b/programs/clock/ChangeLog
@@ -1,3 +1,7 @@
+Wed Mar 11 23:10:37 1998  Karl Backström <karl_b@geocities.com>
+       * [main.c]
+	 Started with the digital clock.
+
 Tue Feb 24 23:26:40 1998  Karl Backström <karl_b@geocities.com>
        * [language.c] [language.h] NEW
 	 Moved language stuff here.
diff --git a/programs/clock/language.c b/programs/clock/language.c
index 3074f0d..c5683d6 100644
--- a/programs/clock/language.c
+++ b/programs/clock/language.c
@@ -15,31 +15,31 @@
 
 CHAR STRING_MENU_Xx[]      = "MENU_Xx";
 
-static BOOL LANGUAGE_LoadStringOtherLanguage(UINT num, UINT ids, LPSTR str, UINT len)
+static BOOL LANGUAGE_LoadStringOther(UINT num, UINT ids, LPSTR str, UINT len)
 {
   ids -= Globals.wStringTableOffset;
   ids += num * 0x100;
   return(LoadString(Globals.hInstance, ids, str, len));
 };
 
-VOID LANGUAGE_SelectLanguageByName(LPCSTR lang)
+VOID LANGUAGE_SelectByName(LPCSTR lang)
 {
   INT i;
   CHAR newlang[3];
 
   for (i = 0; i <= MAX_LANGUAGE_NUMBER; i++)
-    if (LANGUAGE_LoadStringOtherLanguage(i, IDS_LANGUAGE_ID, newlang, sizeof(newlang)) &&
+    if (LANGUAGE_LoadStringOther(i, IDS_LANGUAGE_ID, newlang, sizeof(newlang)) &&
 	!lstrcmp(lang, newlang))
       {
-        LANGUAGE_SelectLanguageByNumber(i);
+        LANGUAGE_SelectByNumber(i);
 	return;
       }
 
   /* Fallback */
     for (i = 0; i <= MAX_LANGUAGE_NUMBER; i++)
-    if (LANGUAGE_LoadStringOtherLanguage(i, IDS_LANGUAGE_ID, newlang, sizeof(newlang)))
+    if (LANGUAGE_LoadStringOther(i, IDS_LANGUAGE_ID, newlang, sizeof(newlang)))
       {
-	LANGUAGE_SelectLanguageByNumber(i);
+	LANGUAGE_SelectByNumber(i);
 	return;
       }
 
@@ -47,7 +47,7 @@
   PostQuitMessage(1);
 }
 
-VOID LANGUAGE_SelectLanguageByNumber(UINT num)
+VOID LANGUAGE_SelectByNumber(UINT num)
 {
   INT    i;
   CHAR   lang[3];
@@ -61,7 +61,6 @@
   /* Get Language id */
   LoadString(Globals.hInstance, IDS_LANGUAGE_ID, lang, sizeof(lang));
   Globals.lpszLanguage = lang;
-  printf(" Globals.lpszLanguage: %s\n", Globals.lpszLanguage);
 
   /* Set frame caption */
   LoadString(Globals.hInstance, IDS_CLOCK, caption, sizeof(caption));
@@ -80,7 +79,7 @@
   RemoveMenu(Globals.hLanguageMenu, 0, MF_BYPOSITION);
   /* Add language items */
   for (i = 0; i <= MAX_LANGUAGE_NUMBER; i++)
-    if (LANGUAGE_LoadStringOtherLanguage(i, IDS_LANGUAGE_MENU_ITEM, item, sizeof(item)))
+    if (LANGUAGE_LoadStringOther(i, IDS_LANGUAGE_MENU_ITEM, item, sizeof(item)))
       AppendMenu(Globals.hLanguageMenu, MF_STRING | MF_BYCOMMAND,
 		 CL_FIRST_LANGUAGE + i, item);
 
@@ -103,6 +102,8 @@
                        MF_BYCOMMAND | MF_CHECKED);
         CheckMenuItem(Globals.hPropertiesMenu, CL_DIGITAL, \
                        MF_BYCOMMAND | MF_UNCHECKED);
+	EnableMenuItem(Globals.hPropertiesMenu, CL_FONT, \
+                       MF_BYCOMMAND | MF_GRAYED);
 }
 else {
 	CheckMenuItem(Globals.hPropertiesMenu, CL_ANALOG, \
@@ -120,25 +121,29 @@
 	                     (Globals.bDate ? MF_CHECKED : MF_UNCHECKED));
 }
 
-VOID LANGUAGE_DefaultLanguageHandle(WPARAM wParam)
+VOID LANGUAGE_DefaultHandle(WPARAM wParam)
 {
   if ((wParam >=CL_FIRST_LANGUAGE) && (wParam<=CL_LAST_LANGUAGE))
-          LANGUAGE_SelectLanguageByNumber(wParam - CL_FIRST_LANGUAGE);
+          LANGUAGE_SelectByNumber(wParam - CL_FIRST_LANGUAGE);
      else printf("Unimplemented menu command %i\n", wParam);
 }
 
-VOID LANGUAGE_InitLanguage(VOID)
+VOID LANGUAGE_Init(VOID)
 {
   #ifdef WINELIB
    Globals.lpszLanguage = Languages[Options.language].name;
-  #else
-  CHAR buffer[MAX_PATHNAME_LEN], *p;
-
-    PROFILE_GetWineIniString("programs", "language", "language", 
+  #endif
+//  #else
+  printf("Globals.lpszLanguage == %s\n", Globals.lpszLanguage);
+  if (Globals.lpszLanguage == "En") {
+    CHAR buffer[MAX_PATHNAME_LEN], *p;
+    printf("Muu\n");
+    PROFILE_GetWineIniString("programs", "language", "En", 
                              buffer, sizeof(buffer));
   Globals.lpszLanguage = p = LocalLock(LocalAlloc(LMEM_FIXED, lstrlen(buffer)));
-  hmemcpy(p, buffer, 1 + lstrlen(buffer));
-  #endif
+  hmemcpy(p, buffer, 1 + lstrlen(buffer)); }
+//  #endif
+//  if (!Globals.lpszLanguage) Globals.lpszLanguage = "En";
 }
 
 /* Local Variables:    */
diff --git a/programs/clock/language.h b/programs/clock/language.h
index 70a7452..27d5c48 100644
--- a/programs/clock/language.h
+++ b/programs/clock/language.h
@@ -5,10 +5,10 @@
  * Copyright 1998 Karl Backström <karl_b@geocities.com>
  */
 
-VOID LANGUAGE_SelectLanguageByNumber(UINT num);
-VOID LANGUAGE_SelectLanguageByName(LPCSTR lang);
-VOID LANGUAGE_DefaultLanguageHandle(WPARAM wParam);
-VOID LANGUAGE_InitLanguage(VOID);
+VOID LANGUAGE_SelectByNumber(UINT num);
+VOID LANGUAGE_SelectByName(LPCSTR lang);
+VOID LANGUAGE_DefaultHandle(WPARAM wParam);
+VOID LANGUAGE_Init(VOID);
 
 /* Local Variables:    */
 /* c-file-style: "GNU" */
diff --git a/programs/clock/main.c b/programs/clock/main.c
index 33ba643..7df6002 100644
--- a/programs/clock/main.c
+++ b/programs/clock/main.c
@@ -16,7 +16,7 @@
 #include "version.h"
 #include "language.h"
 #include "winclock.h"
-// #include "commdlg.h"
+#include "commdlg.h"
 
 #ifdef WINELIB
    #include "options.h"
@@ -38,6 +38,7 @@
 
 int CLOCK_MenuCommand (WPARAM wParam)
 {  
+   CHAR   caption[MAX_STRING_LEN];
    switch (wParam) {
      case CL_ANALOG: {
          Globals.bAnalog = TRUE;
@@ -45,6 +46,9 @@
 	               MF_BYCOMMAND | MF_CHECKED);
 	 CheckMenuItem(Globals.hPropertiesMenu, CL_DIGITAL, \
 	               MF_BYCOMMAND | MF_UNCHECKED);
+	 EnableMenuItem(Globals.hPropertiesMenu, CL_FONT, \
+                       MF_BYCOMMAND | MF_GRAYED);
+	 SendMessage(Globals.hMainWnd, WM_PAINT, 0, 0);
 	 break;	     
        } 
      case CL_DIGITAL: {
@@ -53,35 +57,22 @@
 	               MF_BYCOMMAND | MF_UNCHECKED);
 	 CheckMenuItem(Globals.hPropertiesMenu, CL_DIGITAL, \
 	               MF_BYCOMMAND | MF_CHECKED);
+	 EnableMenuItem(Globals.hPropertiesMenu, CL_FONT, \
+                       MF_BYCOMMAND | MF_ENABLED);
+	 SendMessage(Globals.hMainWnd, WM_PAINT, 0, 0);
 	 break;	       
        }
      case CL_FONT:
-       printf("FONT:");
-/*	CHOOSEFONT fontl;
-	fontl.lStructSize	= 0;
-        fontl.hwndOwner		= Globals.hMainWnd;
-        fontl.hDC		= NULL;
-        fontl.lpLogFont  	= 0;
-        fontl.iPointSize	   	= 0;
-        fontl.Flags		= 0;
-        fontl.rgbColors		= 0;
-        fontl.lCustData		= 0;
-        fontl.lpfnHook		= 0;
-        fontl.lpTemplateName	= 0;
-        fontl.hInstance		= Globals.hInstance;
-        fontl.lpszStyle		= 0;
-        fontl.nFontType		= 0;
-        fontl.nSizeMin		= 0;
-        fontl.nSizeMax		= 100;
-
-	if (ChooseFont(&font)); 
-*/
+	MAIN_FileChooseFont();
        break;
      case CL_WITHOUT_TITLE:
        Globals.bWithoutTitle = !Globals.bWithoutTitle;
        CheckMenuItem(Globals.hPropertiesMenu, CL_WITHOUT_TITLE, MF_BYCOMMAND | \
                      (Globals.bWithoutTitle ? MF_CHECKED : MF_UNCHECKED));
-       printf("NO TITLE:");
+	SetMenu(Globals.hMainWnd, NULL);
+  	SetWindowText(Globals.hMainWnd, NULL);
+    	UpdateWindow (Globals.hMainWnd);
+        printf("NO TITLE:");
        break;
      case CL_ON_TOP:
        Globals.bAlwaysOnTop = !Globals.bAlwaysOnTop;
@@ -92,11 +83,34 @@
        Globals.bSeconds = !Globals.bSeconds;
        CheckMenuItem(Globals.hPropertiesMenu, CL_SECONDS, MF_BYCOMMAND | \
                      (Globals.bSeconds ? MF_CHECKED : MF_UNCHECKED));
+       SendMessage(Globals.hMainWnd, WM_PAINT, 0, 0);
        break;
      case CL_DATE:
        Globals.bDate = !Globals.bDate;
        CheckMenuItem(Globals.hPropertiesMenu, CL_DATE, MF_BYCOMMAND | \
                      (Globals.bDate ? MF_CHECKED : MF_UNCHECKED));
+       LoadString(Globals.hInstance, IDS_CLOCK, caption, sizeof(caption));
+       if (Globals.bDate)
+       {
+	 if (Globals.bAnalog)
+	 {
+	   /* FIXME: Add date to caption */
+	   SetWindowText(Globals.hMainWnd, caption);
+	 }
+	 else
+	 {
+	 }
+       }
+       else 
+       {
+	 if (Globals.bAnalog)
+         {
+           SetWindowText(Globals.hMainWnd, caption);
+         }
+         else
+         {
+         }
+       }
        break;
      case CL_INFO_LICENSE:
        WineLicense(Globals.hMainWnd, Globals.lpszLanguage);
@@ -109,12 +123,33 @@
      break;
      // Handle languages
      default:
-       LANGUAGE_DefaultLanguageHandle(wParam); 
+       LANGUAGE_DefaultHandle(wParam); 
    }
    return 0;
 }
 
+VOID MAIN_FileChooseFont(VOID) {
 
+  CHOOSEFONT font;
+        font.lStructSize       = 0;
+        font.hwndOwner         = Globals.hMainWnd;
+        font.hDC               = NULL;
+        font.lpLogFont         = 0;
+        font.iPointSize        = 0;
+        font.Flags             = 0;
+        font.rgbColors         = 0;
+        font.lCustData         = 0;
+        font.lpfnHook          = 0;
+        font.lpTemplateName    = 0;
+        font.hInstance         = Globals.hInstance;
+        font.lpszStyle         = LF_FACESIZE;
+        font.nFontType         = 0;
+        font.nSizeMin          = 0;
+        font.nSizeMax          = 0;
+
+        if (ChooseFont(&font));
+
+}
 
 /***********************************************************************
  *
@@ -125,6 +160,7 @@
 {
     PAINTSTRUCT ps;
     HDC context;
+    CHAR   caption[MAX_STRING_LEN];
 
     switch (msg) {
 
@@ -134,6 +170,13 @@
 
         case WM_RBUTTONUP:
 	  printf("WM_RBUTTONUP\n");
+	Globals.bWithoutTitle = !Globals.bWithoutTitle;
+	SetMenu(Globals.hMainWnd, Globals.hMainMenu);
+        UpdateWindow (Globals.hMainWnd);
+	CheckMenuItem(Globals.hPropertiesMenu, CL_WITHOUT_TITLE, \
+                       MF_BYCOMMAND | MF_UNCHECKED);
+	LoadString(Globals.hInstance, IDS_CLOCK, caption, sizeof(caption));
+        SetWindowText(Globals.hMainWnd, caption);
 	break;
 
 	case WM_PAINT:
@@ -205,14 +248,13 @@
     printf("WinMain()\n");
     
     /* Setup Globals */
-
     Globals.bAnalog	  = TRUE;
     Globals.bSeconds      = TRUE;
     Globals.lpszIniFile   = "clock.ini";
     Globals.lpszIcoFile   = "clock.ico";
 
   /* Select Language */
-    LANGUAGE_InitLanguage();
+    LANGUAGE_Init();
 
     Globals.hInstance     = hInstance;
     Globals.hMainIcon     = ExtractIcon(Globals.hInstance, 
@@ -242,8 +284,19 @@
 			LoadMenu(Globals.hInstance, STRING_MENU_Xx),
 			Globals.hInstance, 0);
 			
-    LANGUAGE_SelectLanguageByName(Globals.lpszLanguage);
+    LANGUAGE_SelectByName(Globals.lpszLanguage);
     SetMenu(Globals.hMainWnd, Globals.hMainMenu);
+
+//    Globals.hPopupMenu1 = CreatePopupMenu();
+//    Globals.hSystemMenu = GetSystemMenu(Globals.hMainWnd, TRUE);
+//    printf("%i", Globals.hSystemMenu);
+    
+    AppendMenu(Globals.hSystemMenu, MF_STRING | MF_BYCOMMAND,
+                 1000, "item");
+    SetSystemMenu(Globals.hMainWnd, Globals.hSystemMenu);
+
+    EnableMenuItem(Globals.hPropertiesMenu, CL_FONT, \
+                    MF_BYCOMMAND | MF_GRAYED);
     ShowWindow (Globals.hMainWnd, show);
     UpdateWindow (Globals.hMainWnd);
 
diff --git a/programs/clock/main.h b/programs/clock/main.h
index 63741c9..6efaf77 100644
--- a/programs/clock/main.h
+++ b/programs/clock/main.h
@@ -24,6 +24,8 @@
   HMENU   hPropertiesMenu;
   HMENU   hLanguageMenu;
   HMENU   hInfoMenu;
+  HMENU   hSystemMenu;
+  HMENU   hPopupMenu1;
   LPCSTR  lpszIniFile;
   LPCSTR  lpszIcoFile;
   LPCSTR  lpszLanguage;
@@ -42,8 +44,7 @@
 extern CLOCK_GLOBALS Globals;
 
 /* function prototypes */
-VOID MAIN_SelectLanguageByName(LPCSTR);
-VOID MAIN_SelectLanguageByNumber(UINT);
+VOID MAIN_FileChooseFont(VOID);
 
 /* class names */
 
diff --git a/programs/clock/winclock.c b/programs/clock/winclock.c
index 4e7af5f..5ec60e7 100644
--- a/programs/clock/winclock.c
+++ b/programs/clock/winclock.c
@@ -160,6 +160,8 @@
 void Idle(HDC idc)
 {
   SYSTEMTIME st;
+  TEXTMETRIC tm;
+  static short xChar, yChar;
   WORD H, M, S, F;
   int MidX, MidY, DiffX, DiffY;
   HDC dc;
@@ -191,14 +193,22 @@
   if(UpdateSecondHand(dc,MidX+DiffX,MidY+DiffY,MidX*0.79,MidY*0.79,F)) Redraw = TRUE;
   if (Globals.bAnalog)
   {
-  DeleteObject(SelectObject(dc,CreatePen(PS_SOLID,1,HandColor)));
-    if(Redraw)
-    {
-      DrawSecondHand(dc);
-      DrawMinuteHand(dc);
-      DrawHourHand(dc);
-    }
-  DeleteObject(SelectObject(dc,GetStockObject(NULL_PEN))); 
+    DeleteObject(SelectObject(dc,CreatePen(PS_SOLID,1,HandColor)));
+      if(Redraw)
+      {
+        DrawSecondHand(dc);
+        DrawMinuteHand(dc);
+        DrawHourHand(dc);
+      }
+    DeleteObject(SelectObject(dc,GetStockObject(NULL_PEN))); 
+  }
+  else 
+  {
+    SelectObject(dc,CreatePen(PS_SOLID,1,FaceColor));
+    xChar = tm.tmAveCharWidth;
+    yChar = tm.tmHeight;
+    TextOut (dc, xChar, yChar, "Hola", strlen ("Hola")); 
+    DeleteObject(SelectObject(dc,GetStockObject(NULL_PEN)));
   }
   if(!idc) ReleaseDC(Globals.hMainWnd,dc);
 }
diff --git a/programs/notepad/ChangeLog b/programs/notepad/ChangeLog
index b9385c6..710022d 100644
--- a/programs/notepad/ChangeLog
+++ b/programs/notepad/ChangeLog
@@ -1,3 +1,11 @@
+Fri Feb 27 21:03:37 1998  Karl Backström <karl_b@geocities.com>
+	* Fixed some minor features.
+
+Sat Feb 14 17:42:29 1998  Karl Backström <karl_b@geocities.com>
+        * NEW [language.c] [language.h]
+	Takes care of all language related stuff.
+	A new [programs] in .winerc is in use.
+
 Tue Feb 10 23:34:08 1998  Marcel Baur <mbaur@g26.ethz.ch>
         * Fixed broken language menus
 
diff --git a/programs/notepad/De.rc b/programs/notepad/De.rc
index 544fdaa..f409233 100644
--- a/programs/notepad/De.rc
+++ b/programs/notepad/De.rc
@@ -57,7 +57,7 @@
 #define DIALOG_PAGESETUP_CAPTION     "Seite einrichten"
 #define DIALOG_PAGESETUP_HEAD        "&Kopfzeile:"
 #define DIALOG_PAGESETUP_TAIL        "&Fußzeile:"
-#define DIALOG_PAGESETUP_BORDER      "Ränder"
+#define DIALOG_PAGESETUP_MARGIN      "Ränder"
 #define DIALOG_PAGESETUP_LEFT        "&Links:"
 #define DIALOG_PAGESETUP_RIGHT       "&Rechts:"
 #define DIALOG_PAGESETUP_TOP         "&Oben:"
diff --git a/programs/notepad/En.rc b/programs/notepad/En.rc
index 88b4cef..09bb79a 100644
--- a/programs/notepad/En.rc
+++ b/programs/notepad/En.rc
@@ -57,7 +57,7 @@
 #define DIALOG_PAGESETUP_CAPTION     "Page Setup"
 #define DIALOG_PAGESETUP_HEAD        "&Header:"
 #define DIALOG_PAGESETUP_TAIL        "&Footer:"
-#define DIALOG_PAGESETUP_BORDER      "&Margins:"
+#define DIALOG_PAGESETUP_MARGIN      "&Margins:"
 #define DIALOG_PAGESETUP_LEFT        "&Left:"
 #define DIALOG_PAGESETUP_RIGHT       "&Right:"
 #define DIALOG_PAGESETUP_TOP         "&Top:"
diff --git a/programs/notepad/Makefile.in b/programs/notepad/Makefile.in
index 7cb8fae..fa945ad 100644
--- a/programs/notepad/Makefile.in
+++ b/programs/notepad/Makefile.in
@@ -14,7 +14,8 @@
 MOSTSRCS = \
 	license.c \
 	main.c \
-	dialog.c
+	dialog.c \
+	language.c
 
 # Some strings need addresses >= 0x10000
 STRINGSRCS = \
diff --git a/programs/notepad/Sw.rc b/programs/notepad/Sw.rc
index 18c44a0..aa3548b 100644
--- a/programs/notepad/Sw.rc
+++ b/programs/notepad/Sw.rc
@@ -57,7 +57,7 @@
 #define DIALOG_PAGESETUP_CAPTION     "Sid Layout"
 #define DIALOG_PAGESETUP_HEAD        "&Huvudnot:"
 #define DIALOG_PAGESETUP_TAIL        "&Fotnot:"
-#define DIALOG_PAGESETUP_BORDER      "Kanter:"
+#define DIALOG_PAGESETUP_MARGIN      "Kanter:"
 #define DIALOG_PAGESETUP_LEFT        "&Vänster:"
 #define DIALOG_PAGESETUP_RIGHT       "&Höger:"
 #define DIALOG_PAGESETUP_TOP         "&Över:"
diff --git a/programs/notepad/dialog.c b/programs/notepad/dialog.c
index 36167d9..cde9a6b 100644
--- a/programs/notepad/dialog.c
+++ b/programs/notepad/dialog.c
@@ -64,7 +64,9 @@
 	  openfilename.lpfnHook          = 0;
  	  openfilename.lpTemplateName    = 0;
 
-  	  if (GetOpenFileName(&openfilename));
+  	  if (GetOpenFileName(&openfilename)) {
+	  printf("Openfile: %s\n", openfilename.lpstrFile);
+	  }
 }
 
 VOID DIALOG_FileSave(VOID)
@@ -189,7 +191,7 @@
 
 VOID DIALOG_EditTimeDate(VOID)
 {
-  fprintf(stderr, "EditTimeDate()\n");
+  DIALOG_TimeDate();   
 }
 
 VOID DIALOG_EditWrap(VOID)
@@ -244,17 +246,14 @@
 
 VOID DIALOG_HelpNoWarranty(VOID)
 {
-  printf("NP_ABOUT_NO_WARRANTY\n");
         WineWarranty(Globals.hMainWnd, Globals.lpszLanguage);
 }
 
 VOID DIALOG_HelpAboutWine(VOID)
 {
-  printf("NP_ABOUT_WINE\n");
   ShellAbout(Globals.hMainWnd, "Notepad", "Notepad\n" WINE_RELEASE_INFO, 0);
 }
 
-
 /***********************************************************************
  *
  *           DIALOG_PageSetup
@@ -268,6 +267,25 @@
   FreeProcInstance(lpfnDlg);
 }
 
+/***********************************************************************
+ *
+ *           DIALOG_TimeDate
+ */
+
+VOID DIALOG_TimeDate(VOID)
+{
+  SYSTEMTIME st;
+   int H, Min, Y, M, D;
+   GetLocalTime(&st);
+   H = st.wHour; Min = st.wMinute; Y  = st.wYear; M = st.wMonth; D = st.wDay;
+   printf("TimeDate=%i:", H);
+   if (Min < 10) printf("0");
+   printf("%i  %i/", Min, Y);
+   if (M < 10) printf("0");
+   printf("%i/", M);
+   if (D < 10) printf("0");
+   printf("%i\n", D);
+}
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  *
diff --git a/programs/notepad/dialog.h b/programs/notepad/dialog.h
index 47491b4..4d689f6 100644
--- a/programs/notepad/dialog.h
+++ b/programs/notepad/dialog.h
@@ -35,6 +35,7 @@
 VOID DIALOG_HelpAboutWine(VOID);
 
 VOID DIALOG_PageSetup(VOID);
+VOID DIALOG_TimeDate(VOID);
 
 /* Local Variables:    */
 /* c-file-style: "GNU" */
diff --git a/programs/notepad/language.c b/programs/notepad/language.c
new file mode 100644
index 0000000..39f1746
--- /dev/null
+++ b/programs/notepad/language.c
@@ -0,0 +1,127 @@
+/*
+ * Notepad
+ *
+ * Copyright 1997 Marcel Baur <mbaur@g26.ethz.ch>
+ * Copyright 1998 Karl Backström <karl_b@geocities.com>
+ */
+
+#include <stdio.h>
+#include "windows.h"
+#include "main.h"
+#include "language.h"
+#ifdef WINELIB
+#include "options.h"
+#endif
+
+CHAR STRING_MENU_Xx[]      = "MENU_Xx";
+CHAR STRING_PAGESETUP_Xx[] = "DIALOG_PAGESETUP_Xx";
+
+static BOOL LANGUAGE_LoadStringOther(UINT num, UINT ids, LPSTR str, UINT len)
+{
+  ids -= Globals.wStringTableOffset;
+  ids += num * 0x100;
+  return(LoadString(Globals.hInstance, ids, str, len));
+};
+
+VOID LANGUAGE_SelectByName(LPCSTR lang)
+{
+  INT i;
+  CHAR newlang[3];
+
+  for (i = 0; i <= MAX_LANGUAGE_NUMBER; i++)
+    if (LANGUAGE_LoadStringOther(i, IDS_LANGUAGE_ID, newlang, sizeof(newlang)) &&
+	!lstrcmp(lang, newlang))
+      {
+        LANGUAGE_SelectByNumber(i);
+	return;
+      }
+
+  /* Fallback */
+    for (i = 0; i <= MAX_LANGUAGE_NUMBER; i++)
+    if (LANGUAGE_LoadStringOther(i, IDS_LANGUAGE_ID, newlang, sizeof(newlang)))
+      {
+	LANGUAGE_SelectByNumber(i);
+	return;
+      }
+
+  MessageBox(Globals.hMainWnd, "No language found", "FATAL ERROR", MB_OK);
+  PostQuitMessage(1);
+}
+
+VOID LANGUAGE_SelectByNumber(UINT num)
+{
+  INT    i;
+  CHAR   lang[3];
+  CHAR   caption[MAX_STRING_LEN];
+  CHAR   item[MAX_STRING_LEN];
+  HMENU  hMainMenu;
+
+  /* Select string table */
+  Globals.wStringTableOffset = num * 0x100;
+
+  /* Get Language id */
+  LoadString(Globals.hInstance, IDS_LANGUAGE_ID, lang, sizeof(lang));
+  Globals.lpszLanguage = lang;
+
+  /* Set frame caption */
+  LoadString(Globals.hInstance, IDS_NOTEPAD, caption, sizeof(caption));
+  SetWindowText(Globals.hMainWnd, caption);
+
+  /* Change Resource names */
+  lstrcpyn(STRING_MENU_Xx    + sizeof(STRING_MENU_Xx)    - 3, lang, 3);
+  lstrcpyn(STRING_PAGESETUP_Xx    + sizeof(STRING_PAGESETUP_Xx)    - 3, lang, 3);
+
+  /* Create menu */
+  hMainMenu = LoadMenu(Globals.hInstance, STRING_MENU_Xx);
+    Globals.hFileMenu     = GetSubMenu(hMainMenu, 0);
+    Globals.hEditMenu     = GetSubMenu(hMainMenu, 1);
+    Globals.hSearchMenu   = GetSubMenu(hMainMenu, 2);
+    Globals.hLanguageMenu = GetSubMenu(hMainMenu, 3);
+    Globals.hHelpMenu     = GetSubMenu(hMainMenu, 4);
+
+  /* Remove dummy item */
+  RemoveMenu(Globals.hLanguageMenu, 0, MF_BYPOSITION);
+  /* Add language items */
+  for (i = 0; i <= MAX_LANGUAGE_NUMBER; i++)
+    if (LANGUAGE_LoadStringOther(i, IDS_LANGUAGE_MENU_ITEM, item, sizeof(item)))
+      AppendMenu(Globals.hLanguageMenu, MF_STRING | MF_BYCOMMAND,
+		 NP_FIRST_LANGUAGE + i, item);
+
+  SetMenu(Globals.hMainWnd, hMainMenu);
+
+  /* Destroy old menu */
+  if (Globals.hMainMenu) DestroyMenu(Globals.hMainMenu);
+  Globals.hMainMenu = hMainMenu;
+
+#ifdef WINELIB
+  /* Update system menus */
+  for (i = 0; Languages[i].name && lstrcmp(lang, Languages[i].name);) i++;
+  if (Languages[i].name) Options.language = i;
+
+#endif
+}
+
+VOID LANGUAGE_DefaultHandle(WPARAM wParam)
+{
+  if ((wParam >=NP_FIRST_LANGUAGE) && (wParam<=NP_LAST_LANGUAGE))
+          LANGUAGE_SelectByNumber(wParam - NP_FIRST_LANGUAGE);
+     else printf("Unimplemented menu command %i\n", wParam);
+}
+
+VOID LANGUAGE_Init(VOID)
+{
+  #ifdef WINELIB
+   Globals.lpszLanguage = Languages[Options.language].name;
+  #else
+  CHAR buffer[MAX_PATHNAME_LEN], *p;
+
+    PROFILE_GetWineIniString("programs", "language", "language", 
+                             buffer, sizeof(buffer));
+  Globals.lpszLanguage = p = LocalLock(LocalAlloc(LMEM_FIXED, lstrlen(buffer)));
+  hmemcpy(p, buffer, 1 + lstrlen(buffer));
+  #endif
+}
+
+/* Local Variables:    */
+/* c-file-style: "GNU" */
+/* End:                */
diff --git a/programs/notepad/language.h b/programs/notepad/language.h
new file mode 100644
index 0000000..848c4f4
--- /dev/null
+++ b/programs/notepad/language.h
@@ -0,0 +1,15 @@
+/*
+ * Notepad
+ *
+ * Copyright 1997 Marcel Baur <mbaur@g26.ethz.ch>
+ * Copyright 1998 Karl Backström <karl_b@geocities.com>
+ */
+
+VOID LANGUAGE_SelectByNumber(UINT num);
+VOID LANGUAGE_SelectByName(LPCSTR lang);
+VOID LANGUAGE_DefaultHandle(WPARAM wParam);
+VOID LANGUAGE_Init(VOID);
+
+/* Local Variables:    */
+/* c-file-style: "GNU" */
+/* End:                */
diff --git a/programs/notepad/license.c b/programs/notepad/license.c
index eee36e1..b10f2e3 100644
--- a/programs/notepad/license.c
+++ b/programs/notepad/license.c
@@ -7,21 +7,23 @@
 
 static LICENSE* SelectLanguage(LPCSTR Language)
 {
-/*  if (!lstrcmp(Language, "Cz")) return(&WineLicense_Cz); */
-/*  if (!lstrcmp(Language, "Da")) return(&WineLicense_Da); */
-/*  if (!lstrcmp(Language, "De")) return(&WineLicense_De); */
-/*  if (!lstrcmp(Language, "En")) return(&WineLicense_En); */
-/*  if (!lstrcmp(Language, "Eo")) return(&WineLicense_Eo); */
-/*  if (!lstrcmp(Language, "Es")) return(&WineLicense_Es); */
-/*  if (!lstrcmp(Language, "Fi")) return(&WineLicense_Fi); */
-/*  if (!lstrcmp(Language, "Fr")) return(&WineLicense_Fr); */
-/*  if (!lstrcmp(Language, "Hu")) return(&WineLicense_Hu); */
-/*  if (!lstrcmp(Language, "It")) return(&WineLicense_It); */
-/*  if (!lstrcmp(Langauge, "Ko")) return(&WineLicense_Ko); */
-/*  if (!lstrcmp(Language, "No")) return(&WineLicense_No); */
-/*  if (!lstrcmp(Language, "Pl")) return(&WineLicense_Pl); */
-/*  if (!lstrcmp(Language, "Po")) return(&WineLicense_Po); */
-/*  if (!lstrcmp(Language, "Va")) return(&WineLicense_Va); */
+/*  if (lstrcmp(Language, "Cz")) return(&WineLicense_Cz); */
+/*  if (lstrcmp(Language, "Da")) return(&WineLicense_Da); */
+/*  if (lstrcmp(Language, "De")) return(&WineLicense_En); */
+/*  if (lstrcmp(Language, "En")) return(&WineLicense_En); */
+/*  if (lstrcmp(Language, "Eo")) return(&WineLicense_Eo); */
+/*  if (lstrcmp(Language, "Es")) return(&WineLicense_Es); */
+/*  if (lstrcmp(Language, "Fi")) return(&WineLicense_Fi); */
+/*  if (lstrcmp(Language, "Fr")) return(&WineLicense_Fr); */
+/*  if (lstrcmp(Language, "Hu")) return(&WineLicense_Hu); */
+/*  if (lstrcmp(Language, "It")) return(&WineLicense_It); */
+/*  if (lstrcmp(Langauge, "Ko")) return(&WineLicense_Ko); */
+/*  if (lstrcmp(Language, "No")) return(&WineLicense_No); */
+/*  if (lstrcmp(Language, "Pl")) return(&WineLicense_Pl); */
+/*  if (lstrcmp(Language, "Po")) return(&WineLicense_Po); */
+/*  if (lstrcmp(Language, "Va")) return(&WineLicense_Va); */
+/*  if (lstrcmp(Language, "Sw")) return(&WineLicense_Sw); */
+/*  if (lstrcmp(Language, "Ca")) return(&WineLicense_Ca); */
   return(&WineLicense_En);
 }
 
diff --git a/programs/notepad/license.h b/programs/notepad/license.h
index c9a1e8d..5f99cdf 100644
--- a/programs/notepad/license.h
+++ b/programs/notepad/license.h
@@ -26,4 +26,5 @@
 /* extern LICENSE WineLicense_Pl; */
 /* extern LICENSE WineLicense_Po; */
 /* extern LICENSE WineLicense_Va; */
-
+/* extern LICENSE WineLicense_Sw; */
+/* extern LICENSE WineLicense_Ca; */
diff --git a/programs/notepad/main.c b/programs/notepad/main.c
index db12923..a7f8cea 100644
--- a/programs/notepad/main.c
+++ b/programs/notepad/main.c
@@ -9,6 +9,7 @@
 #include "main.h"
 #include "license.h"
 #include "dialog.h"
+#include "language.h"
 #ifdef WINELIB
 #include "options.h"
 #include "resource.h"
@@ -20,136 +21,6 @@
 
 NOTEPAD_GLOBALS Globals;
 
-CHAR STRING_MENU_Xx[]      = "MENU_Xx";
-CHAR STRING_PAGESETUP_Xx[] = "DIALOG_PAGESETUP_Xx";
-
-static BOOL MAIN_LoadStringOtherLanguage(UINT num, UINT ids, LPSTR str, UINT len)
-{
-  ids -= Globals.wStringTableOffset;
-  ids += num * 0x100;
-  return(LoadString(Globals.hInstance, ids, str, len));
-};
-
-VOID MAIN_SelectLanguageByName(LPCSTR lang)
-{
-  INT i;
-  CHAR newlang[3];
-
-  for (i = 0; i <= MAX_LANGUAGE_NUMBER; i++)
-    if (MAIN_LoadStringOtherLanguage(i, IDS_LANGUAGE_ID, newlang, sizeof(newlang)) &&
-	!lstrcmp(lang, newlang))
-      {
-        MAIN_SelectLanguageByNumber(i);
-	return;
-      }
-
-  /* Fallback */
-    for (i = 0; i <= MAX_LANGUAGE_NUMBER; i++)
-    if (MAIN_LoadStringOtherLanguage(i, IDS_LANGUAGE_ID, newlang, sizeof(newlang)))
-      {
-	MAIN_SelectLanguageByNumber(i);
-	return;
-      }
-
-  MessageBox(Globals.hMainWnd, "No language found", "FATAL ERROR", MB_OK);
-  PostQuitMessage(1);
-}
-
-VOID MAIN_SelectLanguageByNumber(UINT num)
-{
-  INT    i;
-  CHAR   lang[3];
-  CHAR   caption[MAX_STRING_LEN];
-  CHAR   item[MAX_STRING_LEN];
-  HMENU  hMainMenu;
-
-  /* Select string table */
-  Globals.wStringTableOffset = num * 0x100;
-
-  /* Get Language id */
-  LoadString(Globals.hInstance, IDS_LANGUAGE_ID, lang, sizeof(lang));
-  Globals.lpszLanguage = lang;
-
-  /* Set frame caption */
-  LoadString(Globals.hInstance, IDS_NOTEPAD, caption, sizeof(caption));
-  SetWindowText(Globals.hMainWnd, caption);
-
-  /* Change Resource names */
-  lstrcpyn(STRING_MENU_Xx    + sizeof(STRING_MENU_Xx)    - 3, lang, 3);
-  lstrcpyn(STRING_PAGESETUP_Xx    + sizeof(STRING_PAGESETUP_Xx)    - 3, lang, 3);
-
-  /* Create menu */
-  hMainMenu = LoadMenu(Globals.hInstance, STRING_MENU_Xx);
-    Globals.hFileMenu     = GetSubMenu(hMainMenu, 0);
-    Globals.hEditMenu     = GetSubMenu(hMainMenu, 1);
-    Globals.hSearchMenu   = GetSubMenu(hMainMenu, 2);
-    Globals.hLanguageMenu = GetSubMenu(hMainMenu, 3);
-    Globals.hHelpMenu     = GetSubMenu(hMainMenu, 4);
-
-  /* Remove dummy item */
-  RemoveMenu(Globals.hLanguageMenu, 0, MF_BYPOSITION);
-  /* Add language items */
-  for (i = 0; i <= MAX_LANGUAGE_NUMBER; i++)
-    if (MAIN_LoadStringOtherLanguage(i, IDS_LANGUAGE_MENU_ITEM, item, sizeof(item)))
-      AppendMenu(Globals.hLanguageMenu, MF_STRING | MF_BYCOMMAND,
-		 NP_FIRST_LANGUAGE + i, item);
-
-  SetMenu(Globals.hMainWnd, hMainMenu);
-
-  /* Destroy old menu */
-  if (Globals.hMainMenu) DestroyMenu(Globals.hMainMenu);
-  Globals.hMainMenu = hMainMenu;
-
-#ifdef WINELIB
-  /* Update system menus */
-  for (i = 0; Languages[i].name && lstrcmp(lang, Languages[i].name);) i++;
-  if (Languages[i].name) Options.language = i;
-
-#endif
-}
-
-/***********************************************************************
- *
- *           NOTEPAD_RegisterLanguages
- *
- *  Handle language stuff at startup
- */
-
-void NOTEPAD_RegisterLanguages(void) {
-
-  LPCSTR opt_lang = "En";
-  CHAR lang[3];
-  INT langnum;
-  
- /* Find language specific string table */
-  for (langnum = 0; langnum <= MAX_LANGUAGE_NUMBER; langnum++)
-    {
-      Globals.wStringTableOffset = langnum * 0x100;
-      if (LoadString(Globals.hInstance, IDS_LANGUAGE_ID, lang, 
-            sizeof(lang)) && !lstrcmp(opt_lang, lang))
-      break;
-    }
-  if (langnum > MAX_LANGUAGE_NUMBER)
-    {
-      /* Find fallback language */
-      for (langnum = 0; langnum <= MAX_LANGUAGE_NUMBER; langnum++)
-	{
-	  Globals.wStringTableOffset = langnum * 0x100;
-	  if (LoadString(Globals.hInstance, IDS_LANGUAGE_ID, lang, sizeof(lang)))
-          break;
-	}
-      if (langnum > MAX_LANGUAGE_NUMBER)
-	{
-	MessageBox(0, "No language found", "FATAL ERROR", MB_OK);
-	PostQuitMessage(0);
-	}
-    }
-
-  /* Change Resource names */
-  lstrcpyn(STRING_MENU_Xx + lstrlen(STRING_MENU_Xx) - 2, lang, 3);
-}
-
-
 /***********************************************************************
  *
  *           NOTEPAD_MenuCommand
@@ -192,9 +63,7 @@
      
      // Handle languages
      default:
-       if ((wParam >=NP_FIRST_LANGUAGE) && (wParam<=NP_LAST_LANGUAGE))
-          MAIN_SelectLanguageByNumber(wParam - NP_FIRST_LANGUAGE);
-     else printf("Unimplemented menu command %i\n", wParam);  
+      LANGUAGE_DefaultHandle(wParam);
    }
    return 0;
 }
@@ -278,11 +147,7 @@
     Globals.lpszIcoFile   = "notepad.ico";
 
   /* Select Language */
-#ifdef WINELIB
-  Globals.lpszLanguage = Languages[Options.language].name;
-#else
-  Globals.lpszLanguage = "En";
-#endif
+    LANGUAGE_Init();
 
     Globals.hInstance     = hInstance;
     Globals.hMainIcon     = ExtractIcon(Globals.hInstance, 
@@ -311,7 +176,8 @@
 			CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0, 
 			LoadMenu(Globals.hInstance, STRING_MENU_Xx),
 			Globals.hInstance, 0);
-    MAIN_SelectLanguageByName(Globals.lpszLanguage);
+
+    LANGUAGE_SelectByName(Globals.lpszLanguage);
 
     SetMenu(Globals.hMainWnd, Globals.hMainMenu);		
 			
@@ -326,9 +192,6 @@
     return 0;
 }
 
-
-
-
 /* Local Variables:    */
 /* c-file-style: "GNU" */
 /* End:                */
diff --git a/programs/notepad/main.h b/programs/notepad/main.h
index c1b08ef..69e7419 100644
--- a/programs/notepad/main.h
+++ b/programs/notepad/main.h
@@ -38,8 +38,6 @@
 /* function prototypes */
 
 /* class names */
-VOID MAIN_SelectLanguageByName(LPCSTR);
-VOID MAIN_SelectLanguageByNumber(UINT);
 
 /* Resource names */
 extern CHAR STRING_MENU_Xx[];
@@ -54,11 +52,18 @@
 #endif
 
 /* string table index */
-#define IDS_LANGUAGE_ID                STRINGID(00)
-#define IDS_LANGUAGE_MENU_ITEM         STRINGID(01)
-#define IDS_NOTEPAD                    STRINGID(02)
-#define IDS_TEXT_FILES_TXT	       STRINGID(03)
-#define IDS_ALL_FILES                  STRINGID(04)
+#define IDS_LANGUAGE_ID                	STRINGID(00)
+#define IDS_LANGUAGE_MENU_ITEM         	STRINGID(01)
+#define IDS_NOTEPAD                    	STRINGID(02)
+#define IDS_TEXT_FILES_TXT	       	STRINGID(03)
+#define IDS_ALL_FILES                  	STRINGID(04)
+#define IDS_ERROR			STRINGID(05)
+#define IDS_WARNING			STRINGID(06)
+#define IDS_INFO			STRINGID(07)
+#define IDS_TOOLARGE			STRINGID(08)
+#define IDS_NOTEXT			STRINGID(09)
+#define IDS_NOTFOUND			STRINGID(0A)
+#define IDS_OUT_OF_MEMORY		STRINGID(0B)
 
 /* main menu */
 
@@ -109,7 +114,7 @@
 #define NP_PAGESETUP_BOTTOM     1011
 #define NP_PAGESETUP_BOTTOM_TXT	1012
 #define NP_HELP			1013
-#define NP_PAGESETUP_BORDER 	1014
+#define NP_PAGESETUP_MARGIN 	1014
 
 
 /* Local Variables:    */
diff --git a/programs/notepad/notepad.rc b/programs/notepad/notepad.rc
index 349d6c5..3ff284e 100644
--- a/programs/notepad/notepad.rc
+++ b/programs/notepad/notepad.rc
@@ -64,13 +64,14 @@
 
 CONCAT(DIALOG_PAGESETUP_, LANGUAGE_ID) DIALOG 0, 0, 225, 95
 STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+FONT 8, "Helv"
 CAPTION DIALOG_PAGESETUP_CAPTION
 {
 LTEXT     DIALOG_PAGESETUP_HEAD, NP_PAGESETUP_HEAD_TXT,     10, 07,  40, 15
 EDITTEXT                            NP_PAGESETUP_HEAD,      60, 05,  110, 12, WS_BORDER | WS_TABSTOP
 LTEXT     DIALOG_PAGESETUP_TAIL, NP_PAGESETUP_TAIL_TXT,     10, 24,  40, 15
 EDITTEXT                            NP_PAGESETUP_TAIL,      60, 22,  110, 12, WS_BORDER | WS_TABSTOP
-GROUPBOX  DIALOG_PAGESETUP_BORDER,  NP_PAGESETUP_BORDER,    10, 43, 160, 45
+GROUPBOX  DIALOG_PAGESETUP_MARGIN,  NP_PAGESETUP_MARGIN,    10, 43, 160, 45
 LTEXT     DIALOG_PAGESETUP_LEFT, NP_PAGESETUP_LEFT_TXT,     20, 55,  30, 10, WS_CHILD
 EDITTEXT                            NP_PAGESETUP_LEFT,	    50, 55,  35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 LTEXT     DIALOG_PAGESETUP_TOP, NP_PAGESETUP_TOP_TXT,	    20, 73,  30, 10, WS_CHILD
@@ -104,4 +105,11 @@
 ADDSTRING(NOTEPAD)
 ADDSTRING(TEXT_FILES_TXT)
 ADDSTRING(ALL_FILES)
+ADDSTRING(ERROR)
+ADDSTRING(WARNING)
+ADDSTRING(INFO)
+ADDSTRING(TOOLARGE)
+ADDSTRING(NOTEXT)
+ADDSTRING(NOTFOUND)
+ADDSTRING(OUT_OF_MEMORY)
 }
diff --git a/programs/view/globals.h b/programs/view/globals.h
index 40a27c1..dea1c60 100644
--- a/programs/view/globals.h
+++ b/programs/view/globals.h
@@ -1,3 +1,4 @@
+
 /*  Add global function prototypes here */
 
 BOOL InitApplication(HINSTANCE);
@@ -14,15 +15,17 @@
 extern char      szAppName[];    /* The name of this application */
 extern char      szTitle[];      /* The title bar text */
 
+
+
 typedef struct
 {
-	DWORD	key;
-	HANDLE	hmf;
-	RECT	bbox;
-	WORD	inch;
-	DWORD	reserved;
-	WORD	checksum;
-} APMFILEHEADER;
+	DWORD	key WINE_PACKED;
+	HANDLE16	hmf WINE_PACKED;
+	RECT16	bbox WINE_PACKED;
+	WORD	inch WINE_PACKED;
+	DWORD	reserved WINE_PACKED;
+	WORD	checksum WINE_PACKED;
+} APMFILEHEADER WINE_PACKED;
 
 #define APMHEADER_KEY	0x9AC6CDD7l
 
diff --git a/programs/view/view.c b/programs/view/view.c
index 52fb99a..3f150b6 100644
--- a/programs/view/view.c
+++ b/programs/view/view.c
@@ -67,7 +67,7 @@
 	    if (FileOpen(hwnd, filename)) {
 	      isAldus = FileIsPlaceable(filename);
 	      if (isAldus) {
-#if 0
+#if 1
 		hmf = GetPlaceableMetaFile(filename);
 #else
 		MessageBox(hwnd, "This is an Aldus placeable metafile: I can't deal with those!",
@@ -143,6 +143,7 @@
 }
 
 /* this code doesn't work */
+#if 1
 HMETAFILE GetPlaceableMetaFile( LPCSTR szFileName )
 {
   HANDLE hData;
@@ -157,10 +158,9 @@
   _llseek(fh, 0, 0);
   if (!_lread(fh, (LPSTR)&APMHeader, sizeof(APMFILEHEADER))) return NULL;
   _llseek(fh, sizeof(APMFILEHEADER), 0);
+  printf("sizeof(APMFILEHEADER) %d\n", sizeof(APMFILEHEADER));
   if (!_lread(fh, (LPSTR)&mfHeader, sizeof(METAHEADER))) return NULL;
 
-  /* somehow mtSize is being swapped */
-
   if (!(hData = GlobalAlloc(GHND, (mfHeader.mtSize * 2L)))) return NULL;
 
   if (!(lpData = GlobalLock(hData)))
@@ -184,10 +184,12 @@
   
   width = APMHeader.bbox.right - APMHeader.bbox.left;
   height = APMHeader.bbox.bottom - APMHeader.bbox.top;
+
+  printf("Ok! width %d height %d\n", width, height);
   deltax = 0;
   deltay = 0 ;
   return hmf;
 }
-
+#endif
 
 
diff --git a/relay32/builtin32.c b/relay32/builtin32.c
index d124093..b5e79aa 100644
--- a/relay32/builtin32.c
+++ b/relay32/builtin32.c
@@ -136,7 +136,7 @@
             + dll->descr->nb_names * sizeof(LPSTR)
             + dll->descr->nb_reg_funcs * sizeof(REG_ENTRY_POINT));
 #ifdef __i386__
-    if (debugging_info(relay))
+    if (TRACE_ON(relay))
         size += dll->descr->nb_funcs * sizeof(DEBUG_ENTRY_POINT);
 #endif
     addr  = VirtualAlloc( NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE );
@@ -201,7 +201,7 @@
     strcpy( sec->Name, ".code" );
     sec->SizeOfRawData = dll->descr->nb_reg_funcs * sizeof(REG_ENTRY_POINT);
 #ifdef __i386__
-    if (debugging_info(relay))
+    if (TRACE_ON(relay))
         sec->SizeOfRawData += dll->descr->nb_funcs * sizeof(DEBUG_ENTRY_POINT);
 #endif
     sec->Misc.VirtualSize = sec->SizeOfRawData;
@@ -222,7 +222,7 @@
 
     /* Build the funcs table */
 
-    if (debugging_info(relay)) dll->dbg_funcs = debug;
+    if (TRACE_ON(relay)) dll->dbg_funcs = debug;
     for (i = 0; i < dll->descr->nb_funcs; i++, funcs++, debug++)
     {
         BYTE args = dll->descr->args[i];
@@ -236,7 +236,7 @@
             regs->jmp         = 0xe9;
             regs->call32_regs = (DWORD)CALL32_Regs - (DWORD)&regs->nop;
             regs->nop         = 0x9090;
-            if (debugging_info(relay))
+            if (TRACE_ON(relay))
             {
                 debug->call       = 0xe8;
                 debug->callfrom32 = (DWORD)regs - (DWORD)&debug->ret;
@@ -251,7 +251,7 @@
             *funcs = (LPVOID)((BYTE *)dll->descr->functions[i] - addr);
             break;
         default:  /* normal function (stdcall or cdecl) */
-            if (debugging_info(relay))
+            if (TRACE_ON(relay))
             {
                 debug->call       = 0xe8;
                 debug->callfrom32 = (DWORD)RELAY_CallFrom32 -
diff --git a/relay32/comctl32.spec b/relay32/comctl32.spec
index 058365d..6e224d2 100644
--- a/relay32/comctl32.spec
+++ b/relay32/comctl32.spec
@@ -30,41 +30,41 @@
 # 23 pascal16 DrawStatusText(word ptr ptr word) DrawStatusText16
  23 stub DrawStatusText
  24 stdcall DrawStatusTextW(long ptr ptr long) DrawStatusText32W
- 25 stub ImageList_Add
+ 25 stdcall ImageList_Add(ptr long long) ImageList_Add
  26 stub ImageList_AddIcon
- 27 stub ImageList_AddMasked
+ 27 stdcall ImageList_AddMasked(ptr long long) ImageList_AddMasked
  28 stub ImageList_BeginDrag
  29 stub ImageList_Copy
- 30 stub ImageList_Create
- 31 stub ImageList_Destroy
+ 30 stdcall ImageList_Create(long long long long long) ImageList_Create
+ 31 stdcall ImageList_Destroy(ptr) ImageList_Destroy
  32 stub ImageList_DragEnter
  33 stub ImageList_DragLeave
  34 stub ImageList_DragMove
  35 stub ImageList_DragShowNolock
- 36 stub ImageList_Draw
+ 36 stdcall ImageList_Draw(ptr long long long long long) ImageList_Draw
  37 stub ImageList_DrawEx
  38 stub ImageList_EndDrag
- 39 stub ImageList_GetBkColor
+ 39 stdcall ImageList_GetBkColor(ptr) ImageList_GetBkColor
  40 stub ImageList_GetDragImage
  41 stub ImageList_GetIcon
- 42 stub ImageList_GetIconSize
- 43 stub ImageList_GetImageCount
- 44 stub ImageList_GetImageInfo
+ 42 stdcall ImageList_GetIconSize(ptr ptr ptr) ImageList_GetIconSize
+ 43 stdcall ImageList_GetImageCount(ptr) ImageList_GetImageCount
+ 44 stdcall ImageList_GetImageInfo(ptr long ptr) ImageList_GetImageInfo
  45 stub ImageList_GetImageRect
  46 stub ImageList_LoadImage
- 47 stub ImageList_LoadImageA
- 48 stub ImageList_LoadImageW
- 49 stub ImageList_Merge
+ 47 stdcall ImageList_LoadImageA(long ptr long long long long long) ImageList_LoadImage32A
+ 48 stdcall ImageList_LoadImageW(long ptr long long long long long) ImageList_LoadImage32W
+ 49 stdcall ImageList_Merge(ptr long ptr long long long) ImageList_Merge
  50 stub ImageList_Read
  51 stub ImageList_Remove
- 52 stub ImageList_Replace
- 53 stub ImageList_ReplaceIcon
- 54 stub ImageList_SetBkColor
+ 52 stdcall ImageList_Replace(ptr long long long) ImageList_Replace
+ 53 stdcall ImageList_ReplaceIcon(ptr long long) ImageList_ReplaceIcon
+ 54 stdcall ImageList_SetBkColor(ptr long) ImageList_SetBkColor
  55 stub ImageList_SetDragCursorImage
  56 stub ImageList_SetFilter
  57 stub ImageList_SetIconSize
  58 stub ImageList_SetImageCount
- 59 stub ImageList_SetOverlayImage
+ 59 stdcall ImageList_SetOverlayImage(ptr long long) ImageList_SetOverlayImage
  60 stub ImageList_Write
  61 stub InitCommonControlsEx
  62 stub PropertySheet
diff --git a/relay32/gdi32.spec b/relay32/gdi32.spec
index 8e82413..1ab4e4b 100644
--- a/relay32/gdi32.spec
+++ b/relay32/gdi32.spec
@@ -16,7 +16,7 @@
  12 stub CheckColorsInGamut
  13 stub ChoosePixelFormat
  14 stdcall Chord(long long long long long long long long long) Chord32
- 15 stub CloseEnhMetaFile
+ 15 stdcall CloseEnhMetaFile(long) CloseEnhMetaFile32
  16 stdcall CloseFigure(long) CloseFigure32
  17 stub CloseMetaFile
  18 stub ColorMatchToTarget
@@ -42,7 +42,7 @@
  38 stdcall CreateDiscardableBitmap(long long long) CreateDiscardableBitmap32
  39 stdcall CreateEllipticRgn(long long long long) CreateEllipticRgn32
  40 stdcall CreateEllipticRgnIndirect(ptr) CreateEllipticRgnIndirect32
- 41 stub CreateEnhMetaFileA
+ 41 stdcall CreateEnhMetaFileA(long ptr ptr ptr) CreateEnhMetaFile32A
  42 stub CreateEnhMetaFileW
  43 stdcall CreateFontA(long long long long long long long long
                         long long long long long str) CreateFont32A
@@ -72,7 +72,7 @@
  65 stdcall DPtoLP(long ptr long) DPtoLP32
  66 stub DeleteColorSpace
  67 stdcall DeleteDC(long) DeleteDC32
- 68 stub DeleteEnhMetaFile
+ 68 stdcall DeleteEnhMetaFile(long) DeleteEnhMetaFile32
  69 stub DeleteMetaFile
  70 stdcall DeleteObject(long)	DeleteObject32
  71 stub DescribePixelFormat
@@ -83,7 +83,7 @@
  76 stub EndDoc
  77 stub EndPage
  78 stdcall EndPath(long) EndPath32
- 79 stub EnumEnhMetaFile
+ 79 stdcall EnumEnhMetaFile(long long ptr ptr ptr) EnumEnhMetaFile32
  80 stdcall EnumFontFamiliesA(long str ptr long) EnumFontFamilies32A
  81 stdcall EnumFontFamiliesExA(long str ptr long long) EnumFontFamiliesEx32A
  82 stdcall EnumFontFamiliesExW(long wstr ptr long long) EnumFontFamiliesEx32W
@@ -178,11 +178,11 @@
 171 stdcall GetDeviceCaps(long long) GetDeviceCaps32
 172 stub GetDeviceGammaRamp
 173 stub GetETM
-174 stub GetEnhMetaFileA
+174 stdcall GetEnhMetaFileA(ptr) GetEnhMetaFile32A
 175 stub GetEnhMetaFileBits
-176 stub GetEnhMetaFileDescriptionA
+176 stdcall GetEnhMetaFileDescriptionA(long long ptr) GetEnhMetaFileDescription32A
 177 stub GetEnhMetaFileDescriptionW
-178 stub GetEnhMetaFileHeader
+178 stdcall GetEnhMetaFileHeader(long long ptr) GetEnhMetaFileHeader32
 179 stub GetEnhMetaFilePaletteEntries
 180 stub GetEnhMetaFileW
 181 stub GetFontData
@@ -267,8 +267,8 @@
 260 stdcall PatBlt(long long long long long long) PatBlt32
 261 stdcall PathToRegion(long) PathToRegion32
 262 stdcall Pie(long long long long long long long long long) Pie32
-263 stub PlayEnhMetaFile
-264 stub PlayEnhMetaFileRecord
+263 stdcall PlayEnhMetaFile(long long ptr) PlayEnhMetaFile32
+264 stdcall PlayEnhMetaFileRecord(long ptr ptr long) PlayEnhMetaFileRecord32
 265 stdcall PlayMetaFile(long long) PlayMetaFile32
 266 stub PlayMetaFileRecord
 267 stub PlgBlt
diff --git a/relay32/kernel32.spec b/relay32/kernel32.spec
index 5da486c..9e1cf92 100644
--- a/relay32/kernel32.spec
+++ b/relay32/kernel32.spec
@@ -20,6 +20,7 @@
  
  10 stub _KERNEL32_stringconv1 #ansi2oem or reverse?
  
+ 17 stub _KERNEL32_17
  18 stdcall _KERNEL32_18(long long) _KERNEL32_18
  19 stub _KERNEL32_getheapsegment
  
@@ -396,7 +397,7 @@
 405 stdcall GetSystemPowerStatus(ptr) GetSystemPowerStatus
 406 stdcall GetSystemTime(ptr) GetSystemTime
 407 stub GetSystemTimeAdjustment
-408 stub GetSystemTimeAsFileTime
+408 stdcall GetSystemTimeAsFileTime(ptr) GetSystemTimeAsFileTime
 409 stub GetTapeParameters
 410 stub GetTapePosition
 411 stub GetTapeStatus
@@ -408,7 +409,7 @@
 417 stdcall GetThreadLocale() GetThreadLocale
 418 stdcall GetThreadPriority(long) GetThreadPriority
 419 stdcall GetThreadSelectorEntry(long long ptr) GetThreadSelectorEntry
-420 stub GetThreadTimes
+420 stdcall GetThreadTimes(long ptr ptr ptr ptr) GetThreadTimes
 421 stdcall GetTickCount() GetTickCount
 422 stdcall GetTimeFormatA(long long ptr str ptr long) GetTimeFormat32A
 423 stub GetTimeFormatW
@@ -734,7 +735,7 @@
 743 stdcall WritePrivateProfileStringW(wstr wstr wstr wstr) WritePrivateProfileString32W
 744 stub WritePrivateProfileStructA
 745 stub WritePrivateProfileStructW
-746 stub WriteProcessMemory
+746 stdcall WriteProcessMemory(long ptr ptr long ptr) WriteProcessMemory
 747 stub WriteProfileSectionA
 748 stub WriteProfileSectionW
 749 stdcall WriteProfileStringA(str str str) WriteProfileString32A
diff --git a/relay32/lz32.spec b/relay32/lz32.spec
index a51a5f1..acfd24b 100644
--- a/relay32/lz32.spec
+++ b/relay32/lz32.spec
@@ -2,7 +2,7 @@
 type	win32
 
 0 stdcall LZCopy(long long) LZCopy32
-1 stdcall LZOpenFileA(ptr ptr long) LZOpenFile32A
+1 stdcall LZOpenFileA(str ptr long) LZOpenFile32A
 2 stdcall LZInit(long) LZInit32
 3 stdcall LZSeek(long long long) LZSeek32
 4 stdcall LZRead(long ptr long) LZRead32
@@ -10,6 +10,6 @@
 6 stdcall LZStart() LZStart32
 7 stdcall CopyLZFile(long long) CopyLZFile32
 8 stdcall LZDone() LZDone
-9 stdcall GetExpandedNameA(ptr ptr) GetExpandedName32A
-10 stdcall LZOpenFileW(ptr ptr long) LZOpenFile32W
-11 stdcall GetExpandedNameW(ptr ptr) GetExpandedName32W
+9 stdcall GetExpandedNameA(str ptr) GetExpandedName32A
+10 stdcall LZOpenFileW(wstr ptr long) LZOpenFile32W
+11 stdcall GetExpandedNameW(wstr ptr) GetExpandedName32W
diff --git a/relay32/olecli32.spec b/relay32/olecli32.spec
index 2034bba..bb86352 100644
--- a/relay32/olecli32.spec
+++ b/relay32/olecli32.spec
@@ -56,4 +56,4 @@
   57 stub OleExecute
   58 stub OleCreateInvisible
   59 stub OleQueryClientVersion
-  60 stub OleIsDcMeta
+  60 stdcall OleIsDcMeta(long) OleIsDcMeta32
diff --git a/relay32/relay386.c b/relay32/relay386.c
index 734c2a5..4115c7b 100644
--- a/relay32/relay386.c
+++ b/relay32/relay386.c
@@ -53,7 +53,7 @@
     BYTE *relay_addr = (BYTE *)args[-1];
     WORD nb_args = *(WORD *)(relay_addr + 1) / sizeof(int);
 
-    assert(debugging_info(relay));
+    assert(TRACE_ON(relay));
     func = (FARPROC32)BUILTIN32_GetEntryPoint( buffer, relay_addr - 5,
                                                &typemask );
     printf( "Call %s(", buffer );
@@ -183,7 +183,7 @@
                            void (CALLBACK *entry_point)(CONTEXT *),
                            BYTE *relay_addr, int ret_addr )
 {
-    if (!debugging_info(relay))
+    if (!TRACE_ON(relay))
     {
         /* Simply call the entry point */
         entry_point( &context );
diff --git a/resources/sysres_Sw.rc b/resources/sysres_Sw.rc
index 24560c3..af9ba49 100644
--- a/resources/sysres_Sw.rc
+++ b/resources/sysres_Sw.rc
@@ -65,7 +65,7 @@
  LTEXT "&Kataloger:", -1, 110, 6, 92, 9
  LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP
  LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP
- LTEXT "Lista över filer av &typen:", 1089, 6, 104, 90, 9
+ LTEXT "Lista filer av &typen:", 1089, 6, 104, 90, 9
  COMBOBOX 1136, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
  LTEXT "&Enheter:", 1091, 110, 104, 92, 9
  COMBOBOX 1137, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP
diff --git a/scheduler/process.c b/scheduler/process.c
index 27d8765..270fdc9 100644
--- a/scheduler/process.c
+++ b/scheduler/process.c
@@ -906,6 +906,20 @@
 }
 
 /***********************************************************************
+ *           WriteProcessMemory    		(KERNEL32)
+ * FIXME: check this, if we ever run win32 binaries in different addressspaces
+ *	  ... and add a sizecheck
+ */
+BOOL32 WINAPI WriteProcessMemory(HANDLE32 hProcess, LPCVOID lpBaseAddress,
+                                 LPVOID lpBuffer, DWORD nSize,
+                                 LPDWORD lpNumberOfBytesWritten )
+{
+	memcpy(lpBaseAddress,lpBuffer,nSize);
+	if (lpNumberOfBytesWritten) *lpNumberOfBytesWritten = nSize;
+	return TRUE;
+}
+
+/***********************************************************************
  *           ConvertToGlobalHandle    		(KERNEL32)
  * FIXME: this is not correctly implemented...
  */
diff --git a/scheduler/synchro.c b/scheduler/synchro.c
index 8056c4a..2a82a41 100644
--- a/scheduler/synchro.c
+++ b/scheduler/synchro.c
@@ -145,8 +145,8 @@
 
     /* Now wait for it */
 
-    dprintf_info(win32, "SYNC: starting wait (%p %04x)\n",
-                   THREAD_Current(), THREAD_Current()->teb_sel );
+    TRACE(win32, "starting wait (%p %04x)\n",
+		 THREAD_Current(), THREAD_Current()->teb_sel );
 
     sigprocmask( SIG_SETMASK, NULL, &set );
     sigdelset( &set, SIGUSR1 );
@@ -181,8 +181,8 @@
     /* Grab the system lock again */
 
     while (count--) SYSTEM_LOCK();
-    dprintf_info(win32, "SYNC: wait finished (%p %04x)\n",
-                   THREAD_Current(), THREAD_Current()->teb_sel );
+    TRACE(win32, "wait finished (%p %04x)\n",
+		 THREAD_Current(), THREAD_Current()->teb_sel );
 
     /* Remove ourselves from the lists */
 
@@ -244,7 +244,7 @@
         THDB *thdb = entry->thread;
         if (SYNC_CheckCondition( &thdb->wait_struct, THDB_TO_THREAD_ID(thdb) ))
         {
-            dprintf_info(win32, "SYNC: waking up %04x\n", thdb->teb_sel );
+            TRACE(win32, "waking up %04x\n", thdb->teb_sel );
             kill( thdb->unix_pid, SIGUSR1 );
             if (!--max) break;
         }
diff --git a/scheduler/thread.c b/scheduler/thread.c
index fdfb34b..3a92052 100644
--- a/scheduler/thread.c
+++ b/scheduler/thread.c
@@ -418,6 +418,12 @@
 
 /**********************************************************************
  *           TlsAlloc   (KERNEL32.530)
+ *
+ * Allocates a thread local storage index
+ *
+ * RETURNS
+ *	TLS Index
+ *	0xFFFFFFFF: Failure
  */
 DWORD WINAPI TlsAlloc(void)
 {
@@ -457,9 +463,13 @@
 
 /**********************************************************************
  *           TlsGetValue   (KERNEL32.532)
+ * RETURNS
+ *	!0: Value stored in calling thread's TLS slot for index
+ *	0: Check GetLastError() for error code
  */
-LPVOID WINAPI TlsGetValue( DWORD index )
-{
+LPVOID WINAPI TlsGetValue(
+	      DWORD index /* TLS index to retrieve value for */
+) {
     THDB *thread = THREAD_Current();
     if (index >= 64)
     {
@@ -473,9 +483,14 @@
 
 /**********************************************************************
  *           TlsSetValue   (KERNEL32.533)
+ * RETURNS
+ *	TRUE: Successful
+ *      FALSE: Failure
  */
-BOOL32 WINAPI TlsSetValue( DWORD index, LPVOID value )
-{
+BOOL32 WINAPI TlsSetValue(
+	      DWORD index, /* TLS index to set value for */
+	      LPVOID value /* value to be stored */
+) {
     THDB *thread = THREAD_Current();
     if (index >= 64)
     {
@@ -570,3 +585,17 @@
     fprintf(stdnimp,"SuspendThread(0x%08x), STUB!\n",handle);
     return TRUE;
 }
+
+/**********************************************************************
+ *           GetThreadTimes   (KERNEL32)
+ */
+BOOL32 WINAPI GetThreadTimes( 
+	HANDLE32 thread, 
+	LPFILETIME creationtime,
+	LPFILETIME exittime,
+	LPFILETIME kerneltime,
+	LPFILETIME usertime
+) {
+	SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+	return FALSE;
+}
diff --git a/tools/find_debug_channels b/tools/find_debug_channels
index 39c5666..dbec877 100644
--- a/tools/find_debug_channels
+++ b/tools/find_debug_channels
@@ -36,6 +36,13 @@
     *    )  files="$@";;
 esac
 
-grep -h dprintf_ $files /dev/null | \
-    sed 's/.*dprintf_[A-Za-z0-9_]\+ *( *\([A-Za-z0-9_]*\).*/\1/g' | \
-    sort | uniq
+(
+grep -h "TRACE *(" $files /dev/null | \
+    sed 's/.*TRACE *( *\([A-Za-z0-9_]*\).*/\1/g'
+grep -h "ERR *(" $files /dev/null | \
+    sed 's/.*ERR *( *\([A-Za-z0-9_]*\).*/\1/g'
+grep -h "FIXME *(" $files /dev/null | \
+    sed 's/.*FIXME *( *\([A-Za-z0-9_]*\).*/\1/g'
+grep -h "WARN *(" $files /dev/null | \
+    sed 's/.*WARN *( *\([A-Za-z0-9_]*\).*/\1/g'
+) | sort | uniq
diff --git a/tools/make_X11wrappers b/tools/make_X11wrappers
index 08b470c..2b34c8b 100755
--- a/tools/make_X11wrappers
+++ b/tools/make_X11wrappers
@@ -211,13 +211,13 @@
 #    print OUTH "#define $fn_name TS$fn_name\n";
     print OUTC "{\n";
     print OUTC "  $resultdecl;\n" if $resultdecl;
-    print OUTC "  dprintf_info(x11, \"Call $fn_name\\n\");\n";
+    print OUTC "  TRACE(x11, \"Call $fn_name\\n\");\n";
     print OUTC "  EnterCriticalSection( &X11DRV_CritSection );\n";
     print OUTC "  ";
     print OUTC "r = " if $resultdecl;
     print OUTC "$fn_name($actuals);\n";
     print OUTC "  LeaveCriticalSection( &X11DRV_CritSection );\n";
-    print OUTC "  dprintf_info(x11, \"Ret $fn_name\\n\");\n";
+    print OUTC "  TRACE(x11, \"Ret $fn_name\\n\");\n";
     print OUTC "  return r;\n" if $resultdecl;
     print OUTC "}\n";
     $want{$fn_name} = 2;
diff --git a/tools/make_debug b/tools/make_debug
index 67451f6..2c1d5c6 100755
--- a/tools/make_debug
+++ b/tools/make_debug
@@ -13,21 +13,32 @@
 DEBUG_DEFS_H="include/debugdefs.h"
 
 DEBUG_CHANNELS="$( tools/find_debug_channels )"
+DEBUG_CLASSES="fixme err warn trace"
 
 {
     cat <<EOF
 /* Do not modify this file -- it is automatically generated! */
 
-#ifndef __DEBUGTOOLS_H
+#ifndef __WINE_DEBUGTOOLS_H
 #include "debugtools.h"
 #endif
 
 EOF
-    i=0
+    echo "/* Definitions for channels identifiers */"
+
+    chno=0
     for ch in $DEBUG_CHANNELS
     do
-	echo "#define dbch_${ch} $i"
-	let i=$i+1
+	echo "#define dbch_${ch} $chno"
+	let chno=$chno+1
+    done
+
+    echo "/* Definitions for classes identifiers */"
+    clno=0
+    for cl in $DEBUG_CLASSES
+    do
+	echo "#define dbcl_${cl} $clno"
+	let clno=$clno+1
     done
 } > $DEBUG_H
 
@@ -38,11 +49,11 @@
     cat <<EOF
 /* Do not modify this file -- it is automatically generated! */
 
-#ifndef __DEBUGTOOLS_H
+#ifndef __WINE_DEBUGTOOLS_H
 #include "debugtools.h"
 #endif
 
-#define DEBUG_CHANNEL_COUNT $i
+#define DEBUG_CHANNEL_COUNT $chno
 #ifdef DEBUG_RUNTIME
 short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
 EOF
@@ -60,10 +71,14 @@
     done
     echo '};'
     
-    cat <<EOF
+    echo 'const char* debug_cl_name[] = {'
+    for ch in $DEBUG_CLASSES
+    do
+	echo "\"${ch}\","
+    done
+    echo '};'
 
-const char* debug_cl_name[] =
-{ "fixme", "err", "warn", "info" };
+    cat <<EOF
 
 #endif /*DEBUG_RUNTIME*/
 
diff --git a/tsx11/ts_xlib.c b/tsx11/ts_xlib.c
index d81cbdf..7ced801 100644
--- a/tsx11/ts_xlib.c
+++ b/tsx11/ts_xlib.c
@@ -11,1252 +11,1252 @@
 XFontStruct * TSXLoadQueryFont(Display* a0, const  char* a1)
 {
   XFontStruct * r;
-  dprintf_info(x11, "Call XLoadQueryFont\n");
+  TRACE(x11, "Call XLoadQueryFont\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XLoadQueryFont(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XLoadQueryFont\n");
+  TRACE(x11, "Ret XLoadQueryFont\n");
   return r;
 }
 
 XModifierKeymap	* TSXGetModifierMapping(Display* a0)
 {
   XModifierKeymap	* r;
-  dprintf_info(x11, "Call XGetModifierMapping\n");
+  TRACE(x11, "Call XGetModifierMapping\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGetModifierMapping(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGetModifierMapping\n");
+  TRACE(x11, "Ret XGetModifierMapping\n");
   return r;
 }
 
 XImage * TSXCreateImage(Display* a0, Visual* a1, unsigned int a2, int a3, int a4, char* a5, unsigned int a6, unsigned int a7, int a8, int a9)
 {
   XImage * r;
-  dprintf_info(x11, "Call XCreateImage\n");
+  TRACE(x11, "Call XCreateImage\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XCreateImage(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XCreateImage\n");
+  TRACE(x11, "Ret XCreateImage\n");
   return r;
 }
 
 XImage * TSXGetImage(Display* a0, Drawable a1, int a2, int a3, unsigned int a4, unsigned int a5, unsigned long a6, int a7)
 {
   XImage * r;
-  dprintf_info(x11, "Call XGetImage\n");
+  TRACE(x11, "Call XGetImage\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGetImage(a0, a1, a2, a3, a4, a5, a6, a7);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGetImage\n");
+  TRACE(x11, "Ret XGetImage\n");
   return r;
 }
 
 Display * TSXOpenDisplay(const  char* a0)
 {
   Display * r;
-  dprintf_info(x11, "Call XOpenDisplay\n");
+  TRACE(x11, "Call XOpenDisplay\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XOpenDisplay(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XOpenDisplay\n");
+  TRACE(x11, "Ret XOpenDisplay\n");
   return r;
 }
 
 void  TSXrmInitialize(void)
 {
-  dprintf_info(x11, "Call XrmInitialize\n");
+  TRACE(x11, "Call XrmInitialize\n");
   EnterCriticalSection( &X11DRV_CritSection );
   XrmInitialize();
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XrmInitialize\n");
+  TRACE(x11, "Ret XrmInitialize\n");
 }
 
 char * TSXGetAtomName(Display* a0, Atom a1)
 {
   char * r;
-  dprintf_info(x11, "Call XGetAtomName\n");
+  TRACE(x11, "Call XGetAtomName\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGetAtomName(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGetAtomName\n");
+  TRACE(x11, "Ret XGetAtomName\n");
   return r;
 }
 
 char * TSXKeysymToString(KeySym a0)
 {
   char * r;
-  dprintf_info(x11, "Call XKeysymToString\n");
+  TRACE(x11, "Call XKeysymToString\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XKeysymToString(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XKeysymToString\n");
+  TRACE(x11, "Ret XKeysymToString\n");
   return r;
 }
 
 Atom  TSXInternAtom(Display* a0, const  char* a1, int a2)
 {
   Atom  r;
-  dprintf_info(x11, "Call XInternAtom\n");
+  TRACE(x11, "Call XInternAtom\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XInternAtom(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XInternAtom\n");
+  TRACE(x11, "Ret XInternAtom\n");
   return r;
 }
 
 Colormap  TSXCreateColormap(Display* a0, Window a1, Visual* a2, int a3)
 {
   Colormap  r;
-  dprintf_info(x11, "Call XCreateColormap\n");
+  TRACE(x11, "Call XCreateColormap\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XCreateColormap(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XCreateColormap\n");
+  TRACE(x11, "Ret XCreateColormap\n");
   return r;
 }
 
 Cursor  TSXCreatePixmapCursor(Display* a0, Pixmap a1, Pixmap a2, XColor* a3, XColor* a4, unsigned int a5, unsigned int a6)
 {
   Cursor  r;
-  dprintf_info(x11, "Call XCreatePixmapCursor\n");
+  TRACE(x11, "Call XCreatePixmapCursor\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XCreatePixmapCursor(a0, a1, a2, a3, a4, a5, a6);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XCreatePixmapCursor\n");
+  TRACE(x11, "Ret XCreatePixmapCursor\n");
   return r;
 }
 
 Cursor  TSXCreateFontCursor(Display* a0, unsigned int a1)
 {
   Cursor  r;
-  dprintf_info(x11, "Call XCreateFontCursor\n");
+  TRACE(x11, "Call XCreateFontCursor\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XCreateFontCursor(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XCreateFontCursor\n");
+  TRACE(x11, "Ret XCreateFontCursor\n");
   return r;
 }
 
 GC  TSXCreateGC(Display* a0, Drawable a1, unsigned long a2, XGCValues* a3)
 {
   GC  r;
-  dprintf_info(x11, "Call XCreateGC\n");
+  TRACE(x11, "Call XCreateGC\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XCreateGC(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XCreateGC\n");
+  TRACE(x11, "Ret XCreateGC\n");
   return r;
 }
 
 Pixmap  TSXCreatePixmap(Display* a0, Drawable a1, unsigned int a2, unsigned int a3, unsigned int a4)
 {
   Pixmap  r;
-  dprintf_info(x11, "Call XCreatePixmap\n");
+  TRACE(x11, "Call XCreatePixmap\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XCreatePixmap(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XCreatePixmap\n");
+  TRACE(x11, "Ret XCreatePixmap\n");
   return r;
 }
 
 Pixmap  TSXCreateBitmapFromData(Display* a0, Drawable a1, const  char* a2, unsigned int a3, unsigned int a4)
 {
   Pixmap  r;
-  dprintf_info(x11, "Call XCreateBitmapFromData\n");
+  TRACE(x11, "Call XCreateBitmapFromData\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XCreateBitmapFromData(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XCreateBitmapFromData\n");
+  TRACE(x11, "Ret XCreateBitmapFromData\n");
   return r;
 }
 
 Window  TSXGetSelectionOwner(Display* a0, Atom a1)
 {
   Window  r;
-  dprintf_info(x11, "Call XGetSelectionOwner\n");
+  TRACE(x11, "Call XGetSelectionOwner\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGetSelectionOwner(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGetSelectionOwner\n");
+  TRACE(x11, "Ret XGetSelectionOwner\n");
   return r;
 }
 
 Window  TSXCreateWindow(Display* a0, Window a1, int a2, int a3, unsigned int a4, unsigned int a5, unsigned int a6, int a7, unsigned int a8, Visual* a9, unsigned long a10, XSetWindowAttributes* a11)
 {
   Window  r;
-  dprintf_info(x11, "Call XCreateWindow\n");
+  TRACE(x11, "Call XCreateWindow\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XCreateWindow(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XCreateWindow\n");
+  TRACE(x11, "Ret XCreateWindow\n");
   return r;
 }
 
 char ** TSXListFonts(Display* a0, const  char* a1, int a2, int* a3)
 {
   char ** r;
-  dprintf_info(x11, "Call XListFonts\n");
+  TRACE(x11, "Call XListFonts\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XListFonts(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XListFonts\n");
+  TRACE(x11, "Ret XListFonts\n");
   return r;
 }
 
 KeySym  TSXKeycodeToKeysym(Display* a0, unsigned int a1, int a2)
 {
   KeySym  r;
-  dprintf_info(x11, "Call XKeycodeToKeysym\n");
+  TRACE(x11, "Call XKeycodeToKeysym\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XKeycodeToKeysym(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XKeycodeToKeysym\n");
+  TRACE(x11, "Ret XKeycodeToKeysym\n");
   return r;
 }
 
 KeySym  TSXLookupKeysym(XKeyEvent* a0, int a1)
 {
   KeySym  r;
-  dprintf_info(x11, "Call XLookupKeysym\n");
+  TRACE(x11, "Call XLookupKeysym\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XLookupKeysym(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XLookupKeysym\n");
+  TRACE(x11, "Ret XLookupKeysym\n");
   return r;
 }
 
 KeySym * TSXGetKeyboardMapping(Display* a0, unsigned int a1, int a2, int* a3)
 {
   KeySym * r;
-  dprintf_info(x11, "Call XGetKeyboardMapping\n");
+  TRACE(x11, "Call XGetKeyboardMapping\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGetKeyboardMapping(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGetKeyboardMapping\n");
+  TRACE(x11, "Ret XGetKeyboardMapping\n");
   return r;
 }
 
 char * TSXResourceManagerString(Display* a0)
 {
   char * r;
-  dprintf_info(x11, "Call XResourceManagerString\n");
+  TRACE(x11, "Call XResourceManagerString\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XResourceManagerString(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XResourceManagerString\n");
+  TRACE(x11, "Ret XResourceManagerString\n");
   return r;
 }
 
 int   TSXInitThreads(void)
 {
   int   r;
-  dprintf_info(x11, "Call XInitThreads\n");
+  TRACE(x11, "Call XInitThreads\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XInitThreads();
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XInitThreads\n");
+  TRACE(x11, "Ret XInitThreads\n");
   return r;
 }
 
 int * TSXListDepths(Display* a0, int a1, int* a2)
 {
   int * r;
-  dprintf_info(x11, "Call XListDepths\n");
+  TRACE(x11, "Call XListDepths\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XListDepths(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XListDepths\n");
+  TRACE(x11, "Ret XListDepths\n");
   return r;
 }
 
 int   TSXReconfigureWMWindow(Display* a0, Window a1, int a2, unsigned int a3, XWindowChanges* a4)
 {
   int   r;
-  dprintf_info(x11, "Call XReconfigureWMWindow\n");
+  TRACE(x11, "Call XReconfigureWMWindow\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XReconfigureWMWindow(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XReconfigureWMWindow\n");
+  TRACE(x11, "Ret XReconfigureWMWindow\n");
   return r;
 }
 
 int   TSXSetWMProtocols(Display* a0, Window a1, Atom* a2, int a3)
 {
   int   r;
-  dprintf_info(x11, "Call XSetWMProtocols\n");
+  TRACE(x11, "Call XSetWMProtocols\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetWMProtocols(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetWMProtocols\n");
+  TRACE(x11, "Ret XSetWMProtocols\n");
   return r;
 }
 
 int  TSXSetTransientForHint(Display* a0, Window a1, Window a2)
 {
   int  r;
-  dprintf_info(x11, "Call XSetTransientForHint\n");
+  TRACE(x11, "Call XSetTransientForHint\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetTransientForHint(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetTransientForHint\n");
+  TRACE(x11, "Ret XSetTransientForHint\n");
   return r;
 }
 
 int  TSXActivateScreenSaver(Display* a0)
 {
   int  r;
-  dprintf_info(x11, "Call XActivateScreenSaver\n");
+  TRACE(x11, "Call XActivateScreenSaver\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XActivateScreenSaver(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XActivateScreenSaver\n");
+  TRACE(x11, "Ret XActivateScreenSaver\n");
   return r;
 }
 
 int   TSXAllocColor(Display* a0, Colormap a1, XColor* a2)
 {
   int   r;
-  dprintf_info(x11, "Call XAllocColor\n");
+  TRACE(x11, "Call XAllocColor\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XAllocColor(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XAllocColor\n");
+  TRACE(x11, "Ret XAllocColor\n");
   return r;
 }
 
 int   TSXAllocColorCells(Display* a0, Colormap a1, int a2, unsigned long* a3, unsigned int a4, unsigned long* a5, unsigned int a6)
 {
   int   r;
-  dprintf_info(x11, "Call XAllocColorCells\n");
+  TRACE(x11, "Call XAllocColorCells\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XAllocColorCells(a0, a1, a2, a3, a4, a5, a6);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XAllocColorCells\n");
+  TRACE(x11, "Ret XAllocColorCells\n");
   return r;
 }
 
 int  TSXBell(Display* a0, int a1)
 {
   int  r;
-  dprintf_info(x11, "Call XBell\n");
+  TRACE(x11, "Call XBell\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XBell(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XBell\n");
+  TRACE(x11, "Ret XBell\n");
   return r;
 }
 
 int  TSXChangeGC(Display* a0, GC a1, unsigned long a2, XGCValues* a3)
 {
   int  r;
-  dprintf_info(x11, "Call XChangeGC\n");
+  TRACE(x11, "Call XChangeGC\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XChangeGC(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XChangeGC\n");
+  TRACE(x11, "Ret XChangeGC\n");
   return r;
 }
 
 int  TSXChangeKeyboardControl(Display* a0, unsigned long a1, XKeyboardControl* a2)
 {
   int  r;
-  dprintf_info(x11, "Call XChangeKeyboardControl\n");
+  TRACE(x11, "Call XChangeKeyboardControl\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XChangeKeyboardControl(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XChangeKeyboardControl\n");
+  TRACE(x11, "Ret XChangeKeyboardControl\n");
   return r;
 }
 
 int  TSXChangeProperty(Display* a0, Window a1, Atom a2, Atom a3, int a4, int a5, const  unsigned char* a6, int a7)
 {
   int  r;
-  dprintf_info(x11, "Call XChangeProperty\n");
+  TRACE(x11, "Call XChangeProperty\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XChangeProperty(a0, a1, a2, a3, a4, a5, a6, a7);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XChangeProperty\n");
+  TRACE(x11, "Ret XChangeProperty\n");
   return r;
 }
 
 int  TSXChangeWindowAttributes(Display* a0, Window a1, unsigned long a2, XSetWindowAttributes* a3)
 {
   int  r;
-  dprintf_info(x11, "Call XChangeWindowAttributes\n");
+  TRACE(x11, "Call XChangeWindowAttributes\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XChangeWindowAttributes(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XChangeWindowAttributes\n");
+  TRACE(x11, "Ret XChangeWindowAttributes\n");
   return r;
 }
 
 int   TSXCheckTypedWindowEvent(Display* a0, Window a1, int a2, XEvent* a3)
 {
   int   r;
-  dprintf_info(x11, "Call XCheckTypedWindowEvent\n");
+  TRACE(x11, "Call XCheckTypedWindowEvent\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XCheckTypedWindowEvent(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XCheckTypedWindowEvent\n");
+  TRACE(x11, "Ret XCheckTypedWindowEvent\n");
   return r;
 }
 
 int   TSXCheckWindowEvent(Display* a0, Window a1, long a2, XEvent* a3)
 {
   int   r;
-  dprintf_info(x11, "Call XCheckWindowEvent\n");
+  TRACE(x11, "Call XCheckWindowEvent\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XCheckWindowEvent(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XCheckWindowEvent\n");
+  TRACE(x11, "Ret XCheckWindowEvent\n");
   return r;
 }
 
 int  TSXConvertSelection(Display* a0, Atom a1, Atom a2, Atom a3, Window a4, Time a5)
 {
   int  r;
-  dprintf_info(x11, "Call XConvertSelection\n");
+  TRACE(x11, "Call XConvertSelection\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XConvertSelection(a0, a1, a2, a3, a4, a5);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XConvertSelection\n");
+  TRACE(x11, "Ret XConvertSelection\n");
   return r;
 }
 
 int  TSXCopyArea(Display* a0, Drawable a1, Drawable a2, GC a3, int a4, int a5, unsigned int a6, unsigned int a7, int a8, int a9)
 {
   int  r;
-  dprintf_info(x11, "Call XCopyArea\n");
+  TRACE(x11, "Call XCopyArea\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XCopyArea(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XCopyArea\n");
+  TRACE(x11, "Ret XCopyArea\n");
   return r;
 }
 
 int  TSXCopyPlane(Display* a0, Drawable a1, Drawable a2, GC a3, int a4, int a5, unsigned int a6, unsigned int a7, int a8, int a9, unsigned long a10)
 {
   int  r;
-  dprintf_info(x11, "Call XCopyPlane\n");
+  TRACE(x11, "Call XCopyPlane\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XCopyPlane(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XCopyPlane\n");
+  TRACE(x11, "Ret XCopyPlane\n");
   return r;
 }
 
 int  TSXDefineCursor(Display* a0, Window a1, Cursor a2)
 {
   int  r;
-  dprintf_info(x11, "Call XDefineCursor\n");
+  TRACE(x11, "Call XDefineCursor\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XDefineCursor(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XDefineCursor\n");
+  TRACE(x11, "Ret XDefineCursor\n");
   return r;
 }
 
 int  TSXDestroyWindow(Display* a0, Window a1)
 {
   int  r;
-  dprintf_info(x11, "Call XDestroyWindow\n");
+  TRACE(x11, "Call XDestroyWindow\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XDestroyWindow(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XDestroyWindow\n");
+  TRACE(x11, "Ret XDestroyWindow\n");
   return r;
 }
 
 int  TSXDisplayKeycodes(Display* a0, int* a1, int* a2)
 {
   int  r;
-  dprintf_info(x11, "Call XDisplayKeycodes\n");
+  TRACE(x11, "Call XDisplayKeycodes\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XDisplayKeycodes(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XDisplayKeycodes\n");
+  TRACE(x11, "Ret XDisplayKeycodes\n");
   return r;
 }
 
 int  TSXDrawArc(Display* a0, Drawable a1, GC a2, int a3, int a4, unsigned int a5, unsigned int a6, int a7, int a8)
 {
   int  r;
-  dprintf_info(x11, "Call XDrawArc\n");
+  TRACE(x11, "Call XDrawArc\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XDrawArc(a0, a1, a2, a3, a4, a5, a6, a7, a8);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XDrawArc\n");
+  TRACE(x11, "Ret XDrawArc\n");
   return r;
 }
 
 int  TSXDrawLine(Display* a0, Drawable a1, GC a2, int a3, int a4, int a5, int a6)
 {
   int  r;
-  dprintf_info(x11, "Call XDrawLine\n");
+  TRACE(x11, "Call XDrawLine\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XDrawLine(a0, a1, a2, a3, a4, a5, a6);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XDrawLine\n");
+  TRACE(x11, "Ret XDrawLine\n");
   return r;
 }
 
 int  TSXDrawLines(Display* a0, Drawable a1, GC a2, XPoint* a3, int a4, int a5)
 {
   int  r;
-  dprintf_info(x11, "Call XDrawLines\n");
+  TRACE(x11, "Call XDrawLines\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XDrawLines(a0, a1, a2, a3, a4, a5);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XDrawLines\n");
+  TRACE(x11, "Ret XDrawLines\n");
   return r;
 }
 
 int  TSXDrawPoint(Display* a0, Drawable a1, GC a2, int a3, int a4)
 {
   int  r;
-  dprintf_info(x11, "Call XDrawPoint\n");
+  TRACE(x11, "Call XDrawPoint\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XDrawPoint(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XDrawPoint\n");
+  TRACE(x11, "Ret XDrawPoint\n");
   return r;
 }
 
 int  TSXDrawRectangle(Display* a0, Drawable a1, GC a2, int a3, int a4, unsigned int a5, unsigned int a6)
 {
   int  r;
-  dprintf_info(x11, "Call XDrawRectangle\n");
+  TRACE(x11, "Call XDrawRectangle\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XDrawRectangle(a0, a1, a2, a3, a4, a5, a6);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XDrawRectangle\n");
+  TRACE(x11, "Ret XDrawRectangle\n");
   return r;
 }
 
 int  TSXDrawSegments(Display* a0, Drawable a1, GC a2, XSegment* a3, int a4)
 {
   int  r;
-  dprintf_info(x11, "Call XDrawSegments\n");
+  TRACE(x11, "Call XDrawSegments\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XDrawSegments(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XDrawSegments\n");
+  TRACE(x11, "Ret XDrawSegments\n");
   return r;
 }
 
 int  TSXDrawString(Display* a0, Drawable a1, GC a2, int a3, int a4, const  char* a5, int a6)
 {
   int  r;
-  dprintf_info(x11, "Call XDrawString\n");
+  TRACE(x11, "Call XDrawString\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XDrawString(a0, a1, a2, a3, a4, a5, a6);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XDrawString\n");
+  TRACE(x11, "Ret XDrawString\n");
   return r;
 }
 
 int  TSXDrawText(Display* a0, Drawable a1, GC a2, int a3, int a4, XTextItem* a5, int a6)
 {
   int  r;
-  dprintf_info(x11, "Call XDrawText\n");
+  TRACE(x11, "Call XDrawText\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XDrawText(a0, a1, a2, a3, a4, a5, a6);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XDrawText\n");
+  TRACE(x11, "Ret XDrawText\n");
   return r;
 }
 
 int  TSXFillArc(Display* a0, Drawable a1, GC a2, int a3, int a4, unsigned int a5, unsigned int a6, int a7, int a8)
 {
   int  r;
-  dprintf_info(x11, "Call XFillArc\n");
+  TRACE(x11, "Call XFillArc\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XFillArc(a0, a1, a2, a3, a4, a5, a6, a7, a8);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XFillArc\n");
+  TRACE(x11, "Ret XFillArc\n");
   return r;
 }
 
 int  TSXFillPolygon(Display* a0, Drawable a1, GC a2, XPoint* a3, int a4, int a5, int a6)
 {
   int  r;
-  dprintf_info(x11, "Call XFillPolygon\n");
+  TRACE(x11, "Call XFillPolygon\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XFillPolygon(a0, a1, a2, a3, a4, a5, a6);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XFillPolygon\n");
+  TRACE(x11, "Ret XFillPolygon\n");
   return r;
 }
 
 int  TSXFillRectangle(Display* a0, Drawable a1, GC a2, int a3, int a4, unsigned int a5, unsigned int a6)
 {
   int  r;
-  dprintf_info(x11, "Call XFillRectangle\n");
+  TRACE(x11, "Call XFillRectangle\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XFillRectangle(a0, a1, a2, a3, a4, a5, a6);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XFillRectangle\n");
+  TRACE(x11, "Ret XFillRectangle\n");
   return r;
 }
 
 int  TSXFlush(Display* a0)
 {
   int  r;
-  dprintf_info(x11, "Call XFlush\n");
+  TRACE(x11, "Call XFlush\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XFlush(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XFlush\n");
+  TRACE(x11, "Ret XFlush\n");
   return r;
 }
 
 int  TSXFree(void* a0)
 {
   int  r;
-  dprintf_info(x11, "Call XFree\n");
+  TRACE(x11, "Call XFree\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XFree(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XFree\n");
+  TRACE(x11, "Ret XFree\n");
   return r;
 }
 
 int  TSXFreeColormap(Display* a0, Colormap a1)
 {
   int  r;
-  dprintf_info(x11, "Call XFreeColormap\n");
+  TRACE(x11, "Call XFreeColormap\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XFreeColormap(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XFreeColormap\n");
+  TRACE(x11, "Ret XFreeColormap\n");
   return r;
 }
 
 int  TSXFreeColors(Display* a0, Colormap a1, unsigned long* a2, int a3, unsigned long a4)
 {
   int  r;
-  dprintf_info(x11, "Call XFreeColors\n");
+  TRACE(x11, "Call XFreeColors\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XFreeColors(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XFreeColors\n");
+  TRACE(x11, "Ret XFreeColors\n");
   return r;
 }
 
 int  TSXFreeCursor(Display* a0, Cursor a1)
 {
   int  r;
-  dprintf_info(x11, "Call XFreeCursor\n");
+  TRACE(x11, "Call XFreeCursor\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XFreeCursor(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XFreeCursor\n");
+  TRACE(x11, "Ret XFreeCursor\n");
   return r;
 }
 
 int  TSXFreeFont(Display* a0, XFontStruct* a1)
 {
   int  r;
-  dprintf_info(x11, "Call XFreeFont\n");
+  TRACE(x11, "Call XFreeFont\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XFreeFont(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XFreeFont\n");
+  TRACE(x11, "Ret XFreeFont\n");
   return r;
 }
 
 int  TSXFreeFontNames(char** a0)
 {
   int  r;
-  dprintf_info(x11, "Call XFreeFontNames\n");
+  TRACE(x11, "Call XFreeFontNames\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XFreeFontNames(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XFreeFontNames\n");
+  TRACE(x11, "Ret XFreeFontNames\n");
   return r;
 }
 
 int  TSXFreeGC(Display* a0, GC a1)
 {
   int  r;
-  dprintf_info(x11, "Call XFreeGC\n");
+  TRACE(x11, "Call XFreeGC\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XFreeGC(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XFreeGC\n");
+  TRACE(x11, "Ret XFreeGC\n");
   return r;
 }
 
 int  TSXFreeModifiermap(XModifierKeymap* a0)
 {
   int  r;
-  dprintf_info(x11, "Call XFreeModifiermap\n");
+  TRACE(x11, "Call XFreeModifiermap\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XFreeModifiermap(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XFreeModifiermap\n");
+  TRACE(x11, "Ret XFreeModifiermap\n");
   return r;
 }
 
 int  TSXFreePixmap(Display* a0, Pixmap a1)
 {
   int  r;
-  dprintf_info(x11, "Call XFreePixmap\n");
+  TRACE(x11, "Call XFreePixmap\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XFreePixmap(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XFreePixmap\n");
+  TRACE(x11, "Ret XFreePixmap\n");
   return r;
 }
 
 int   TSXGetFontProperty(XFontStruct* a0, Atom a1, unsigned long* a2)
 {
   int   r;
-  dprintf_info(x11, "Call XGetFontProperty\n");
+  TRACE(x11, "Call XGetFontProperty\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGetFontProperty(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGetFontProperty\n");
+  TRACE(x11, "Ret XGetFontProperty\n");
   return r;
 }
 
 int   TSXGetGeometry(Display* a0, Drawable a1, Window* a2, int* a3, int* a4, unsigned int* a5, unsigned int* a6, unsigned int* a7, unsigned int* a8)
 {
   int   r;
-  dprintf_info(x11, "Call XGetGeometry\n");
+  TRACE(x11, "Call XGetGeometry\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGetGeometry(a0, a1, a2, a3, a4, a5, a6, a7, a8);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGetGeometry\n");
+  TRACE(x11, "Ret XGetGeometry\n");
   return r;
 }
 
 int  TSXGetInputFocus(Display* a0, Window* a1, int* a2)
 {
   int  r;
-  dprintf_info(x11, "Call XGetInputFocus\n");
+  TRACE(x11, "Call XGetInputFocus\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGetInputFocus(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGetInputFocus\n");
+  TRACE(x11, "Ret XGetInputFocus\n");
   return r;
 }
 
 int  TSXGetKeyboardControl(Display* a0, XKeyboardState* a1)
 {
   int  r;
-  dprintf_info(x11, "Call XGetKeyboardControl\n");
+  TRACE(x11, "Call XGetKeyboardControl\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGetKeyboardControl(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGetKeyboardControl\n");
+  TRACE(x11, "Ret XGetKeyboardControl\n");
   return r;
 }
 
 int  TSXGetScreenSaver(Display* a0, int* a1, int* a2, int* a3, int* a4)
 {
   int  r;
-  dprintf_info(x11, "Call XGetScreenSaver\n");
+  TRACE(x11, "Call XGetScreenSaver\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGetScreenSaver(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGetScreenSaver\n");
+  TRACE(x11, "Ret XGetScreenSaver\n");
   return r;
 }
 
 int  TSXGetWindowProperty(Display* a0, Window a1, Atom a2, long a3, long a4, int a5, Atom a6, Atom* a7, int* a8, unsigned long* a9, unsigned long* a10, unsigned char** a11)
 {
   int  r;
-  dprintf_info(x11, "Call XGetWindowProperty\n");
+  TRACE(x11, "Call XGetWindowProperty\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGetWindowProperty(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGetWindowProperty\n");
+  TRACE(x11, "Ret XGetWindowProperty\n");
   return r;
 }
 
 int   TSXGetWindowAttributes(Display* a0, Window a1, XWindowAttributes* a2)
 {
   int   r;
-  dprintf_info(x11, "Call XGetWindowAttributes\n");
+  TRACE(x11, "Call XGetWindowAttributes\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGetWindowAttributes(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGetWindowAttributes\n");
+  TRACE(x11, "Ret XGetWindowAttributes\n");
   return r;
 }
 
 int  TSXGrabPointer(Display* a0, Window a1, int a2, unsigned int a3, int a4, int a5, Window a6, Cursor a7, Time a8)
 {
   int  r;
-  dprintf_info(x11, "Call XGrabPointer\n");
+  TRACE(x11, "Call XGrabPointer\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGrabPointer(a0, a1, a2, a3, a4, a5, a6, a7, a8);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGrabPointer\n");
+  TRACE(x11, "Ret XGrabPointer\n");
   return r;
 }
 
 int  TSXGrabServer(Display* a0)
 {
   int  r;
-  dprintf_info(x11, "Call XGrabServer\n");
+  TRACE(x11, "Call XGrabServer\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGrabServer(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGrabServer\n");
+  TRACE(x11, "Ret XGrabServer\n");
   return r;
 }
 
 int  TSXInstallColormap(Display* a0, Colormap a1)
 {
   int  r;
-  dprintf_info(x11, "Call XInstallColormap\n");
+  TRACE(x11, "Call XInstallColormap\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XInstallColormap(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XInstallColormap\n");
+  TRACE(x11, "Ret XInstallColormap\n");
   return r;
 }
 
 KeyCode  TSXKeysymToKeycode(Display* a0, KeySym a1)
 {
   KeyCode  r;
-  dprintf_info(x11, "Call XKeysymToKeycode\n");
+  TRACE(x11, "Call XKeysymToKeycode\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XKeysymToKeycode(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XKeysymToKeycode\n");
+  TRACE(x11, "Ret XKeysymToKeycode\n");
   return r;
 }
 
 int  TSXMapWindow(Display* a0, Window a1)
 {
   int  r;
-  dprintf_info(x11, "Call XMapWindow\n");
+  TRACE(x11, "Call XMapWindow\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XMapWindow(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XMapWindow\n");
+  TRACE(x11, "Ret XMapWindow\n");
   return r;
 }
 
 int  TSXNextEvent(Display* a0, XEvent* a1)
 {
   int  r;
-  dprintf_info(x11, "Call XNextEvent\n");
+  TRACE(x11, "Call XNextEvent\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XNextEvent(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XNextEvent\n");
+  TRACE(x11, "Ret XNextEvent\n");
   return r;
 }
 
 int  TSXParseGeometry(const  char* a0, int* a1, int* a2, unsigned int* a3, unsigned int* a4)
 {
   int  r;
-  dprintf_info(x11, "Call XParseGeometry\n");
+  TRACE(x11, "Call XParseGeometry\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XParseGeometry(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XParseGeometry\n");
+  TRACE(x11, "Ret XParseGeometry\n");
   return r;
 }
 
 int  TSXPending(Display* a0)
 {
   int  r;
-  dprintf_info(x11, "Call XPending\n");
+  TRACE(x11, "Call XPending\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XPending(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XPending\n");
+  TRACE(x11, "Ret XPending\n");
   return r;
 }
 
 int  TSXPutBackEvent(Display* a0, XEvent* a1)
 {
   int  r;
-  dprintf_info(x11, "Call XPutBackEvent\n");
+  TRACE(x11, "Call XPutBackEvent\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XPutBackEvent(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XPutBackEvent\n");
+  TRACE(x11, "Ret XPutBackEvent\n");
   return r;
 }
 
 int  TSXPutImage(Display* a0, Drawable a1, GC a2, XImage* a3, int a4, int a5, int a6, int a7, unsigned int a8, unsigned int a9)
 {
   int  r;
-  dprintf_info(x11, "Call XPutImage\n");
+  TRACE(x11, "Call XPutImage\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XPutImage(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XPutImage\n");
+  TRACE(x11, "Ret XPutImage\n");
   return r;
 }
 
 int  TSXQueryColor(Display* a0, Colormap a1, XColor* a2)
 {
   int  r;
-  dprintf_info(x11, "Call XQueryColor\n");
+  TRACE(x11, "Call XQueryColor\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XQueryColor(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XQueryColor\n");
+  TRACE(x11, "Ret XQueryColor\n");
   return r;
 }
 
 int   TSXQueryPointer(Display* a0, Window a1, Window* a2, Window* a3, int* a4, int* a5, int* a6, int* a7, unsigned int* a8)
 {
   int   r;
-  dprintf_info(x11, "Call XQueryPointer\n");
+  TRACE(x11, "Call XQueryPointer\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XQueryPointer(a0, a1, a2, a3, a4, a5, a6, a7, a8);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XQueryPointer\n");
+  TRACE(x11, "Ret XQueryPointer\n");
   return r;
 }
 
 int   TSXQueryTree(Display* a0, Window a1, Window* a2, Window* a3, Window** a4, unsigned int* a5)
 {
   int   r;
-  dprintf_info(x11, "Call XQueryTree\n");
+  TRACE(x11, "Call XQueryTree\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XQueryTree(a0, a1, a2, a3, a4, a5);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XQueryTree\n");
+  TRACE(x11, "Ret XQueryTree\n");
   return r;
 }
 
 int  TSXResetScreenSaver(Display* a0)
 {
   int  r;
-  dprintf_info(x11, "Call XResetScreenSaver\n");
+  TRACE(x11, "Call XResetScreenSaver\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XResetScreenSaver(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XResetScreenSaver\n");
+  TRACE(x11, "Ret XResetScreenSaver\n");
   return r;
 }
 
 int  TSXRestackWindows(Display* a0, Window* a1, int a2)
 {
   int  r;
-  dprintf_info(x11, "Call XRestackWindows\n");
+  TRACE(x11, "Call XRestackWindows\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XRestackWindows(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XRestackWindows\n");
+  TRACE(x11, "Ret XRestackWindows\n");
   return r;
 }
 
 int   TSXSendEvent(Display* a0, Window a1, int a2, long a3, XEvent* a4)
 {
   int   r;
-  dprintf_info(x11, "Call XSendEvent\n");
+  TRACE(x11, "Call XSendEvent\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSendEvent(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSendEvent\n");
+  TRACE(x11, "Ret XSendEvent\n");
   return r;
 }
 
 int  TSXSetArcMode(Display* a0, GC a1, int a2)
 {
   int  r;
-  dprintf_info(x11, "Call XSetArcMode\n");
+  TRACE(x11, "Call XSetArcMode\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetArcMode(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetArcMode\n");
+  TRACE(x11, "Ret XSetArcMode\n");
   return r;
 }
 
 int  TSXSetBackground(Display* a0, GC a1, unsigned long a2)
 {
   int  r;
-  dprintf_info(x11, "Call XSetBackground\n");
+  TRACE(x11, "Call XSetBackground\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetBackground(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetBackground\n");
+  TRACE(x11, "Ret XSetBackground\n");
   return r;
 }
 
 int  TSXSetClipMask(Display* a0, GC a1, Pixmap a2)
 {
   int  r;
-  dprintf_info(x11, "Call XSetClipMask\n");
+  TRACE(x11, "Call XSetClipMask\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetClipMask(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetClipMask\n");
+  TRACE(x11, "Ret XSetClipMask\n");
   return r;
 }
 
 int  TSXSetClipOrigin(Display* a0, GC a1, int a2, int a3)
 {
   int  r;
-  dprintf_info(x11, "Call XSetClipOrigin\n");
+  TRACE(x11, "Call XSetClipOrigin\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetClipOrigin(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetClipOrigin\n");
+  TRACE(x11, "Ret XSetClipOrigin\n");
   return r;
 }
 
 int  TSXSetClipRectangles(Display* a0, GC a1, int a2, int a3, XRectangle* a4, int a5, int a6)
 {
   int  r;
-  dprintf_info(x11, "Call XSetClipRectangles\n");
+  TRACE(x11, "Call XSetClipRectangles\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetClipRectangles(a0, a1, a2, a3, a4, a5, a6);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetClipRectangles\n");
+  TRACE(x11, "Ret XSetClipRectangles\n");
   return r;
 }
 
 int  TSXSetDashes(Display* a0, GC a1, int a2, const  char* a3, int a4)
 {
   int  r;
-  dprintf_info(x11, "Call XSetDashes\n");
+  TRACE(x11, "Call XSetDashes\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetDashes(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetDashes\n");
+  TRACE(x11, "Ret XSetDashes\n");
   return r;
 }
 
 int  TSXSetFillStyle(Display* a0, GC a1, int a2)
 {
   int  r;
-  dprintf_info(x11, "Call XSetFillStyle\n");
+  TRACE(x11, "Call XSetFillStyle\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetFillStyle(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetFillStyle\n");
+  TRACE(x11, "Ret XSetFillStyle\n");
   return r;
 }
 
 int  TSXSetForeground(Display* a0, GC a1, unsigned long a2)
 {
   int  r;
-  dprintf_info(x11, "Call XSetForeground\n");
+  TRACE(x11, "Call XSetForeground\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetForeground(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetForeground\n");
+  TRACE(x11, "Ret XSetForeground\n");
   return r;
 }
 
 int  TSXSetFunction(Display* a0, GC a1, int a2)
 {
   int  r;
-  dprintf_info(x11, "Call XSetFunction\n");
+  TRACE(x11, "Call XSetFunction\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetFunction(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetFunction\n");
+  TRACE(x11, "Ret XSetFunction\n");
   return r;
 }
 
 int  TSXSetGraphicsExposures(Display* a0, GC a1, int a2)
 {
   int  r;
-  dprintf_info(x11, "Call XSetGraphicsExposures\n");
+  TRACE(x11, "Call XSetGraphicsExposures\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetGraphicsExposures(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetGraphicsExposures\n");
+  TRACE(x11, "Ret XSetGraphicsExposures\n");
   return r;
 }
 
 int  TSXSetIconName(Display* a0, Window a1, const  char* a2)
 {
   int  r;
-  dprintf_info(x11, "Call XSetIconName\n");
+  TRACE(x11, "Call XSetIconName\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetIconName(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetIconName\n");
+  TRACE(x11, "Ret XSetIconName\n");
   return r;
 }
 
 int  TSXSetInputFocus(Display* a0, Window a1, int a2, Time a3)
 {
   int  r;
-  dprintf_info(x11, "Call XSetInputFocus\n");
+  TRACE(x11, "Call XSetInputFocus\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetInputFocus(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetInputFocus\n");
+  TRACE(x11, "Ret XSetInputFocus\n");
   return r;
 }
 
 int  TSXSetLineAttributes(Display* a0, GC a1, unsigned int a2, int a3, int a4, int a5)
 {
   int  r;
-  dprintf_info(x11, "Call XSetLineAttributes\n");
+  TRACE(x11, "Call XSetLineAttributes\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetLineAttributes(a0, a1, a2, a3, a4, a5);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetLineAttributes\n");
+  TRACE(x11, "Ret XSetLineAttributes\n");
   return r;
 }
 
 int  TSXSetScreenSaver(Display* a0, int a1, int a2, int a3, int a4)
 {
   int  r;
-  dprintf_info(x11, "Call XSetScreenSaver\n");
+  TRACE(x11, "Call XSetScreenSaver\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetScreenSaver(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetScreenSaver\n");
+  TRACE(x11, "Ret XSetScreenSaver\n");
   return r;
 }
 
 int  TSXSetSelectionOwner(Display* a0, Atom a1, Window a2, Time a3)
 {
   int  r;
-  dprintf_info(x11, "Call XSetSelectionOwner\n");
+  TRACE(x11, "Call XSetSelectionOwner\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetSelectionOwner(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetSelectionOwner\n");
+  TRACE(x11, "Ret XSetSelectionOwner\n");
   return r;
 }
 
 int  TSXSetSubwindowMode(Display* a0, GC a1, int a2)
 {
   int  r;
-  dprintf_info(x11, "Call XSetSubwindowMode\n");
+  TRACE(x11, "Call XSetSubwindowMode\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetSubwindowMode(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetSubwindowMode\n");
+  TRACE(x11, "Ret XSetSubwindowMode\n");
   return r;
 }
 
 int  TSXStoreColor(Display* a0, Colormap a1, XColor* a2)
 {
   int  r;
-  dprintf_info(x11, "Call XStoreColor\n");
+  TRACE(x11, "Call XStoreColor\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XStoreColor(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XStoreColor\n");
+  TRACE(x11, "Ret XStoreColor\n");
   return r;
 }
 
 int  TSXStoreName(Display* a0, Window a1, const  char* a2)
 {
   int  r;
-  dprintf_info(x11, "Call XStoreName\n");
+  TRACE(x11, "Call XStoreName\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XStoreName(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XStoreName\n");
+  TRACE(x11, "Ret XStoreName\n");
   return r;
 }
 
 int  TSXSync(Display* a0, int a1)
 {
   int  r;
-  dprintf_info(x11, "Call XSync\n");
+  TRACE(x11, "Call XSync\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSync(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSync\n");
+  TRACE(x11, "Ret XSync\n");
   return r;
 }
 
 int  TSXTextExtents(XFontStruct* a0, const  char* a1, int a2, int* a3, int* a4, int* a5, XCharStruct* a6)
 {
   int  r;
-  dprintf_info(x11, "Call XTextExtents\n");
+  TRACE(x11, "Call XTextExtents\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XTextExtents(a0, a1, a2, a3, a4, a5, a6);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XTextExtents\n");
+  TRACE(x11, "Ret XTextExtents\n");
   return r;
 }
 
 int  TSXTextWidth(XFontStruct* a0, const  char* a1, int a2)
 {
   int  r;
-  dprintf_info(x11, "Call XTextWidth\n");
+  TRACE(x11, "Call XTextWidth\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XTextWidth(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XTextWidth\n");
+  TRACE(x11, "Ret XTextWidth\n");
   return r;
 }
 
 int  TSXUngrabPointer(Display* a0, Time a1)
 {
   int  r;
-  dprintf_info(x11, "Call XUngrabPointer\n");
+  TRACE(x11, "Call XUngrabPointer\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XUngrabPointer(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XUngrabPointer\n");
+  TRACE(x11, "Ret XUngrabPointer\n");
   return r;
 }
 
 int  TSXUngrabServer(Display* a0)
 {
   int  r;
-  dprintf_info(x11, "Call XUngrabServer\n");
+  TRACE(x11, "Call XUngrabServer\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XUngrabServer(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XUngrabServer\n");
+  TRACE(x11, "Ret XUngrabServer\n");
   return r;
 }
 
 int  TSXUninstallColormap(Display* a0, Colormap a1)
 {
   int  r;
-  dprintf_info(x11, "Call XUninstallColormap\n");
+  TRACE(x11, "Call XUninstallColormap\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XUninstallColormap(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XUninstallColormap\n");
+  TRACE(x11, "Ret XUninstallColormap\n");
   return r;
 }
 
 int  TSXUnmapWindow(Display* a0, Window a1)
 {
   int  r;
-  dprintf_info(x11, "Call XUnmapWindow\n");
+  TRACE(x11, "Call XUnmapWindow\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XUnmapWindow(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XUnmapWindow\n");
+  TRACE(x11, "Ret XUnmapWindow\n");
   return r;
 }
 
 int  TSXWarpPointer(Display* a0, Window a1, Window a2, int a3, int a4, unsigned int a5, unsigned int a6, int a7, int a8)
 {
   int  r;
-  dprintf_info(x11, "Call XWarpPointer\n");
+  TRACE(x11, "Call XWarpPointer\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XWarpPointer(a0, a1, a2, a3, a4, a5, a6, a7, a8);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XWarpPointer\n");
+  TRACE(x11, "Ret XWarpPointer\n");
   return r;
 }
 
 int (*TSXSynchronize(Display *a0, Bool a1))(Display *)
 {
   int (*r)(Display *);
-  dprintf_info(x11, "Call XSynchronize\n");
+  TRACE(x11, "Call XSynchronize\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSynchronize(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSynchronize\n");
+  TRACE(x11, "Ret XSynchronize\n");
   return r;
 }
 
@@ -1264,9 +1264,9 @@
 
 void TS_XInitImageFuncPtrs(XImage *a0)
 {
-  dprintf_info(x11, "Call _XInitImageFuncPtrs\n");
+  TRACE(x11, "Call _XInitImageFuncPtrs\n");
   EnterCriticalSection( &X11DRV_CritSection );
   _XInitImageFuncPtrs(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret _XInitImageFuncPtrs\n");
+  TRACE(x11, "Ret _XInitImageFuncPtrs\n");
 }
diff --git a/tsx11/ts_xpm.c b/tsx11/ts_xpm.c
index 9ef6d9c..cb252b4 100644
--- a/tsx11/ts_xpm.c
+++ b/tsx11/ts_xpm.c
@@ -11,21 +11,21 @@
 int TSXpmCreatePixmapFromData(Display *a0, Drawable a1, char **a2, Pixmap *a3, Pixmap *a4, XpmAttributes *a5)
 {
   int r;
-  dprintf_info(x11, "Call XpmCreatePixmapFromData\n");
+  TRACE(x11, "Call XpmCreatePixmapFromData\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XpmCreatePixmapFromData(a0, a1, a2, a3, a4, a5);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XpmCreatePixmapFromData\n");
+  TRACE(x11, "Ret XpmCreatePixmapFromData\n");
   return r;
 }
 
 int TSXpmAttributesSize(void)
 {
   int r;
-  dprintf_info(x11, "Call XpmAttributesSize\n");
+  TRACE(x11, "Call XpmAttributesSize\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XpmAttributesSize();
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XpmAttributesSize\n");
+  TRACE(x11, "Ret XpmAttributesSize\n");
   return r;
 }
diff --git a/tsx11/ts_xresource.c b/tsx11/ts_xresource.c
index b272b1e..6aee90d 100644
--- a/tsx11/ts_xresource.c
+++ b/tsx11/ts_xresource.c
@@ -12,61 +12,61 @@
 XrmQuark  TSXrmUniqueQuark(void)
 {
   XrmQuark  r;
-  dprintf_info(x11, "Call XrmUniqueQuark\n");
+  TRACE(x11, "Call XrmUniqueQuark\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XrmUniqueQuark();
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XrmUniqueQuark\n");
+  TRACE(x11, "Ret XrmUniqueQuark\n");
   return r;
 }
 
 int   TSXrmGetResource(XrmDatabase a0, const  char* a1, const  char* a2, char** a3, XrmValue* a4)
 {
   int   r;
-  dprintf_info(x11, "Call XrmGetResource\n");
+  TRACE(x11, "Call XrmGetResource\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XrmGetResource(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XrmGetResource\n");
+  TRACE(x11, "Ret XrmGetResource\n");
   return r;
 }
 
 XrmDatabase  TSXrmGetFileDatabase(const  char* a0)
 {
   XrmDatabase  r;
-  dprintf_info(x11, "Call XrmGetFileDatabase\n");
+  TRACE(x11, "Call XrmGetFileDatabase\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XrmGetFileDatabase(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XrmGetFileDatabase\n");
+  TRACE(x11, "Ret XrmGetFileDatabase\n");
   return r;
 }
 
 XrmDatabase  TSXrmGetStringDatabase(const  char* a0)
 {
   XrmDatabase  r;
-  dprintf_info(x11, "Call XrmGetStringDatabase\n");
+  TRACE(x11, "Call XrmGetStringDatabase\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XrmGetStringDatabase(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XrmGetStringDatabase\n");
+  TRACE(x11, "Ret XrmGetStringDatabase\n");
   return r;
 }
 
 void  TSXrmMergeDatabases(XrmDatabase a0, XrmDatabase* a1)
 {
-  dprintf_info(x11, "Call XrmMergeDatabases\n");
+  TRACE(x11, "Call XrmMergeDatabases\n");
   EnterCriticalSection( &X11DRV_CritSection );
   XrmMergeDatabases(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XrmMergeDatabases\n");
+  TRACE(x11, "Ret XrmMergeDatabases\n");
 }
 
 void  TSXrmParseCommand(XrmDatabase* a0, XrmOptionDescList a1, int a2, const  char* a3, int* a4, char** a5)
 {
-  dprintf_info(x11, "Call XrmParseCommand\n");
+  TRACE(x11, "Call XrmParseCommand\n");
   EnterCriticalSection( &X11DRV_CritSection );
   XrmParseCommand(a0, a1, a2, a3, a4, a5);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XrmParseCommand\n");
+  TRACE(x11, "Ret XrmParseCommand\n");
 }
diff --git a/tsx11/ts_xshm.c b/tsx11/ts_xshm.c
index 9892f8f..e3afe6b 100644
--- a/tsx11/ts_xshm.c
+++ b/tsx11/ts_xshm.c
@@ -12,43 +12,43 @@
 Bool TSXShmQueryExtension(Display *a0)
 {
   Bool r;
-  dprintf_info(x11, "Call XShmQueryExtension\n");
+  TRACE(x11, "Call XShmQueryExtension\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XShmQueryExtension(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XShmQueryExtension\n");
+  TRACE(x11, "Ret XShmQueryExtension\n");
   return r;
 }
 
 int TSXShmPixmapFormat(Display *a0)
 {
   int r;
-  dprintf_info(x11, "Call XShmPixmapFormat\n");
+  TRACE(x11, "Call XShmPixmapFormat\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XShmPixmapFormat(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XShmPixmapFormat\n");
+  TRACE(x11, "Ret XShmPixmapFormat\n");
   return r;
 }
 
 Status TSXShmDetach(Display *a0, XShmSegmentInfo *a1)
 {
   Status r;
-  dprintf_info(x11, "Call XShmDetach\n");
+  TRACE(x11, "Call XShmDetach\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XShmDetach(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XShmDetach\n");
+  TRACE(x11, "Ret XShmDetach\n");
   return r;
 }
 
 Status TSXShmAttach(Display *a0, XShmSegmentInfo *a1)
 {
   Status r;
-  dprintf_info(x11, "Call XShmAttach\n");
+  TRACE(x11, "Call XShmAttach\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XShmAttach(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XShmAttach\n");
+  TRACE(x11, "Ret XShmAttach\n");
   return r;
 }
diff --git a/tsx11/ts_xutil.c b/tsx11/ts_xutil.c
index ab44751..9556c82 100644
--- a/tsx11/ts_xutil.c
+++ b/tsx11/ts_xutil.c
@@ -13,347 +13,347 @@
 XClassHint * TSXAllocClassHint(void)
 {
   XClassHint * r;
-  dprintf_info(x11, "Call XAllocClassHint\n");
+  TRACE(x11, "Call XAllocClassHint\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XAllocClassHint();
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XAllocClassHint\n");
+  TRACE(x11, "Ret XAllocClassHint\n");
   return r;
 }
 
 XSizeHints * TSXAllocSizeHints(void)
 {
   XSizeHints * r;
-  dprintf_info(x11, "Call XAllocSizeHints\n");
+  TRACE(x11, "Call XAllocSizeHints\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XAllocSizeHints();
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XAllocSizeHints\n");
+  TRACE(x11, "Ret XAllocSizeHints\n");
   return r;
 }
 
 XWMHints * TSXAllocWMHints(void)
 {
   XWMHints * r;
-  dprintf_info(x11, "Call XAllocWMHints\n");
+  TRACE(x11, "Call XAllocWMHints\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XAllocWMHints();
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XAllocWMHints\n");
+  TRACE(x11, "Ret XAllocWMHints\n");
   return r;
 }
 
 int  TSXClipBox(Region a0, XRectangle* a1)
 {
   int  r;
-  dprintf_info(x11, "Call XClipBox\n");
+  TRACE(x11, "Call XClipBox\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XClipBox(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XClipBox\n");
+  TRACE(x11, "Ret XClipBox\n");
   return r;
 }
 
 Region  TSXCreateRegion(void)
 {
   Region  r;
-  dprintf_info(x11, "Call XCreateRegion\n");
+  TRACE(x11, "Call XCreateRegion\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XCreateRegion();
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XCreateRegion\n");
+  TRACE(x11, "Ret XCreateRegion\n");
   return r;
 }
 
 int  TSXDeleteContext(Display* a0, XID a1, XContext a2)
 {
   int  r;
-  dprintf_info(x11, "Call XDeleteContext\n");
+  TRACE(x11, "Call XDeleteContext\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XDeleteContext(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XDeleteContext\n");
+  TRACE(x11, "Ret XDeleteContext\n");
   return r;
 }
 
 int  TSXDestroyRegion(Region a0)
 {
   int  r;
-  dprintf_info(x11, "Call XDestroyRegion\n");
+  TRACE(x11, "Call XDestroyRegion\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XDestroyRegion(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XDestroyRegion\n");
+  TRACE(x11, "Ret XDestroyRegion\n");
   return r;
 }
 
 int  TSXEmptyRegion(Region a0)
 {
   int  r;
-  dprintf_info(x11, "Call XEmptyRegion\n");
+  TRACE(x11, "Call XEmptyRegion\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XEmptyRegion(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XEmptyRegion\n");
+  TRACE(x11, "Ret XEmptyRegion\n");
   return r;
 }
 
 int  TSXEqualRegion(Region a0, Region a1)
 {
   int  r;
-  dprintf_info(x11, "Call XEqualRegion\n");
+  TRACE(x11, "Call XEqualRegion\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XEqualRegion(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XEqualRegion\n");
+  TRACE(x11, "Ret XEqualRegion\n");
   return r;
 }
 
 int  TSXFindContext(Display* a0, XID a1, XContext a2, XPointer* a3)
 {
   int  r;
-  dprintf_info(x11, "Call XFindContext\n");
+  TRACE(x11, "Call XFindContext\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XFindContext(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XFindContext\n");
+  TRACE(x11, "Ret XFindContext\n");
   return r;
 }
 
 XVisualInfo * TSXGetVisualInfo(Display* a0, long a1, XVisualInfo* a2, int* a3)
 {
   XVisualInfo * r;
-  dprintf_info(x11, "Call XGetVisualInfo\n");
+  TRACE(x11, "Call XGetVisualInfo\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGetVisualInfo(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGetVisualInfo\n");
+  TRACE(x11, "Ret XGetVisualInfo\n");
   return r;
 }
 
 int   TSXGetWMSizeHints(Display* a0, Window a1, XSizeHints* a2, long* a3, Atom a4)
 {
   int   r;
-  dprintf_info(x11, "Call XGetWMSizeHints\n");
+  TRACE(x11, "Call XGetWMSizeHints\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XGetWMSizeHints(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XGetWMSizeHints\n");
+  TRACE(x11, "Ret XGetWMSizeHints\n");
   return r;
 }
 
 int  TSXIntersectRegion(Region a0, Region a1, Region a2)
 {
   int  r;
-  dprintf_info(x11, "Call XIntersectRegion\n");
+  TRACE(x11, "Call XIntersectRegion\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XIntersectRegion(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XIntersectRegion\n");
+  TRACE(x11, "Ret XIntersectRegion\n");
   return r;
 }
 
 int  TSXLookupString(XKeyEvent* a0, char* a1, int a2, KeySym* a3, XComposeStatus* a4)
 {
   int  r;
-  dprintf_info(x11, "Call XLookupString\n");
+  TRACE(x11, "Call XLookupString\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XLookupString(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XLookupString\n");
+  TRACE(x11, "Ret XLookupString\n");
   return r;
 }
 
 int  TSXOffsetRegion(Region a0, int a1, int a2)
 {
   int  r;
-  dprintf_info(x11, "Call XOffsetRegion\n");
+  TRACE(x11, "Call XOffsetRegion\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XOffsetRegion(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XOffsetRegion\n");
+  TRACE(x11, "Ret XOffsetRegion\n");
   return r;
 }
 
 int   TSXPointInRegion(Region a0, int a1, int a2)
 {
   int   r;
-  dprintf_info(x11, "Call XPointInRegion\n");
+  TRACE(x11, "Call XPointInRegion\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XPointInRegion(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XPointInRegion\n");
+  TRACE(x11, "Ret XPointInRegion\n");
   return r;
 }
 
 Region  TSXPolygonRegion(XPoint* a0, int a1, int a2)
 {
   Region  r;
-  dprintf_info(x11, "Call XPolygonRegion\n");
+  TRACE(x11, "Call XPolygonRegion\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XPolygonRegion(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XPolygonRegion\n");
+  TRACE(x11, "Ret XPolygonRegion\n");
   return r;
 }
 
 int  TSXRectInRegion(Region a0, int a1, int a2, unsigned int a3, unsigned int a4)
 {
   int  r;
-  dprintf_info(x11, "Call XRectInRegion\n");
+  TRACE(x11, "Call XRectInRegion\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XRectInRegion(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XRectInRegion\n");
+  TRACE(x11, "Ret XRectInRegion\n");
   return r;
 }
 
 int  TSXSaveContext(Display* a0, XID a1, XContext a2, const  char* a3)
 {
   int  r;
-  dprintf_info(x11, "Call XSaveContext\n");
+  TRACE(x11, "Call XSaveContext\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSaveContext(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSaveContext\n");
+  TRACE(x11, "Ret XSaveContext\n");
   return r;
 }
 
 void  TSXSetWMProperties(Display* a0, Window a1, XTextProperty* a2, XTextProperty* a3, char** a4, int a5, XSizeHints* a6, XWMHints* a7, XClassHint* a8)
 {
-  dprintf_info(x11, "Call XSetWMProperties\n");
+  TRACE(x11, "Call XSetWMProperties\n");
   EnterCriticalSection( &X11DRV_CritSection );
   XSetWMProperties(a0, a1, a2, a3, a4, a5, a6, a7, a8);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetWMProperties\n");
+  TRACE(x11, "Ret XSetWMProperties\n");
 }
 
 void  TSXSetWMSizeHints(Display* a0, Window a1, XSizeHints* a2, Atom a3)
 {
-  dprintf_info(x11, "Call XSetWMSizeHints\n");
+  TRACE(x11, "Call XSetWMSizeHints\n");
   EnterCriticalSection( &X11DRV_CritSection );
   XSetWMSizeHints(a0, a1, a2, a3);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetWMSizeHints\n");
+  TRACE(x11, "Ret XSetWMSizeHints\n");
 }
 
 int  TSXSetRegion(Display* a0, GC a1, Region a2)
 {
   int  r;
-  dprintf_info(x11, "Call XSetRegion\n");
+  TRACE(x11, "Call XSetRegion\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSetRegion(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSetRegion\n");
+  TRACE(x11, "Ret XSetRegion\n");
   return r;
 }
 
 int  TSXShrinkRegion(Region a0, int a1, int a2)
 {
   int  r;
-  dprintf_info(x11, "Call XShrinkRegion\n");
+  TRACE(x11, "Call XShrinkRegion\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XShrinkRegion(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XShrinkRegion\n");
+  TRACE(x11, "Ret XShrinkRegion\n");
   return r;
 }
 
 int   TSXStringListToTextProperty(char** a0, int a1, XTextProperty* a2)
 {
   int   r;
-  dprintf_info(x11, "Call XStringListToTextProperty\n");
+  TRACE(x11, "Call XStringListToTextProperty\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XStringListToTextProperty(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XStringListToTextProperty\n");
+  TRACE(x11, "Ret XStringListToTextProperty\n");
   return r;
 }
 
 int  TSXSubtractRegion(Region a0, Region a1, Region a2)
 {
   int  r;
-  dprintf_info(x11, "Call XSubtractRegion\n");
+  TRACE(x11, "Call XSubtractRegion\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSubtractRegion(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSubtractRegion\n");
+  TRACE(x11, "Ret XSubtractRegion\n");
   return r;
 }
 
 int  TSXUnionRectWithRegion(XRectangle* a0, Region a1, Region a2)
 {
   int  r;
-  dprintf_info(x11, "Call XUnionRectWithRegion\n");
+  TRACE(x11, "Call XUnionRectWithRegion\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XUnionRectWithRegion(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XUnionRectWithRegion\n");
+  TRACE(x11, "Ret XUnionRectWithRegion\n");
   return r;
 }
 
 int  TSXUnionRegion(Region a0, Region a1, Region a2)
 {
   int  r;
-  dprintf_info(x11, "Call XUnionRegion\n");
+  TRACE(x11, "Call XUnionRegion\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XUnionRegion(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XUnionRegion\n");
+  TRACE(x11, "Ret XUnionRegion\n");
   return r;
 }
 
 int  TSXXorRegion(Region a0, Region a1, Region a2)
 {
   int  r;
-  dprintf_info(x11, "Call XXorRegion\n");
+  TRACE(x11, "Call XXorRegion\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XXorRegion(a0, a1, a2);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XXorRegion\n");
+  TRACE(x11, "Ret XXorRegion\n");
   return r;
 }
 
 int TSXDestroyImage(struct _XImage *a0)
 {
   int r;
-  dprintf_info(x11, "Call XDestroyImage\n");
+  TRACE(x11, "Call XDestroyImage\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XDestroyImage(a0);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XDestroyImage\n");
+  TRACE(x11, "Ret XDestroyImage\n");
   return r;
 }
 
 struct _XImage * TSXSubImage(struct _XImage *a0, int a1, int a2, unsigned int a3, unsigned int a4)
 {
   struct _XImage * r;
-  dprintf_info(x11, "Call XSubImage\n");
+  TRACE(x11, "Call XSubImage\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XSubImage(a0, a1, a2, a3, a4);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XSubImage\n");
+  TRACE(x11, "Ret XSubImage\n");
   return r;
 }
 
 int TSXAddPixel(struct _XImage *a0, long a1)
 {
   int r;
-  dprintf_info(x11, "Call XAddPixel\n");
+  TRACE(x11, "Call XAddPixel\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XAddPixel(a0, a1);
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XAddPixel\n");
+  TRACE(x11, "Ret XAddPixel\n");
   return r;
 }
 
 XContext TSXUniqueContext(void)
 {
   XContext r;
-  dprintf_info(x11, "Call XUniqueContext\n");
+  TRACE(x11, "Call XUniqueContext\n");
   EnterCriticalSection( &X11DRV_CritSection );
   r = XUniqueContext();
   LeaveCriticalSection( &X11DRV_CritSection );
-  dprintf_info(x11, "Ret XUniqueContext\n");
+  TRACE(x11, "Ret XUniqueContext\n");
   return r;
 }
diff --git a/win32/code_page.c b/win32/code_page.c
index bcd80ce..6ef3335 100644
--- a/win32/code_page.c
+++ b/win32/code_page.c
@@ -207,7 +207,7 @@
  */
 BOOL32 WINAPI EnumSystemCodePages32A(CODEPAGE_ENUMPROC32A lpfnCodePageEnum,DWORD flags)
 {
-	dprintf_info(win32,"EnumSystemCodePages32A(%p,%08lx)\n",
+	TRACE(win32,"(%p,%08lx)\n",
 		lpfnCodePageEnum,flags
 	);
 	lpfnCodePageEnum("437");
@@ -221,7 +221,7 @@
                                       DWORD flags)
 {
     WCHAR	*cp;
-    dprintf_info(win32,"EnumSystemCodePages32W(%p,%08lx)\n",
+    TRACE(win32,"(%p,%08lx)\n",
                   lpfnCodePageEnum,flags );
 
     cp = HEAP_strdupAtoW( GetProcessHeap(), 0, "437" );
diff --git a/win32/console.c b/win32/console.c
index d2f13b5..3bbf9f6 100644
--- a/win32/console.c
+++ b/win32/console.c
@@ -44,6 +44,7 @@
 	int	master;			/* xterm side of pty */
 	int	slave;			/* wine side of pty */
 	int	pid;			/* xterm's pid, -1 if no xterm */
+        LPSTR   title;                  /* title of console */
 } CONSOLE;
 
 
@@ -79,6 +80,9 @@
 
 	obj->type = K32OBJ_UNKNOWN;
 
+	if (console->title)
+	  	  HeapFree( SystemHeap, 0, console->title );
+	console->title = NULL;
 	/* make sure a xterm exists to kill */
 	if (console->pid != -1) {
 		kill(console->pid, SIGTERM);
@@ -94,8 +98,8 @@
 	CONSOLE *console = (CONSOLE *)ptr;
 	int result;
 
-	dprintf_info(console, "CONSOLE_Read: %p %p %ld\n", ptr, lpBuffer,
-		      nNumberOfChars);
+	TRACE(console, "%p %p %ld\n", ptr, lpBuffer,
+		     nNumberOfChars);
 
 	*lpNumberOfChars = 0; 
 
@@ -107,6 +111,7 @@
 	return TRUE;
 }
 
+
 /* lpOverlapped is ignored */
 static BOOL32 CONSOLE_Write(K32OBJ *ptr, LPCVOID lpBuffer, 
 			    DWORD nNumberOfChars,
@@ -115,19 +120,28 @@
 	CONSOLE *console = (CONSOLE *)ptr;
 	int result;
 
-	dprintf_info(console, "CONSOLE_Write: %p %p %ld\n", ptr, lpBuffer,
-		      nNumberOfChars);
+	TRACE(console, "%p %p %ld\n", ptr, lpBuffer,
+		     nNumberOfChars);
 
 	*lpNumberOfChars = 0; 
 
-	/* FIXME: there was a loop here before, why??? */
+	/* 
+	 * I assume this loop around EAGAIN is here because
+	 * win32 doesn't have interrupted system calls 
+	 */
 
-	if ((result = write(console->slave, lpBuffer, nNumberOfChars)) == -1) {
-		FILE_SetDosError();
-		return FALSE;
-	}
-	*lpNumberOfChars = result;
-	return TRUE;
+	for (;;)
+        {
+		result = write(console->slave, lpBuffer, nNumberOfChars);
+		if (result != -1) {
+			*lpNumberOfChars = result;
+                        return TRUE;
+		}
+		if (errno != EINTR) {
+			FILE_SetDosError();
+			return FALSE;
+		}
+        }
 }
 
 
@@ -365,6 +379,7 @@
         console->header.type     = K32OBJ_CONSOLE;
         console->header.refcount = 1;
         console->pid             = -1;
+        console->title           = NULL;
 
 	if (wine_createConsole(&master, &slave, &pid) == FALSE) {
 		K32OBJ_DecCount(&console->header);
@@ -413,6 +428,7 @@
 
 	SetLastError(ERROR_SUCCESS);
 	SYSTEM_UNLOCK();
+	SetConsoleTitle32A("Wine Console");
 	return TRUE;
 }
 
@@ -449,8 +465,8 @@
  */
 BOOL32 WINAPI SetConsoleMode(HANDLE32 hcon,DWORD mode)
 {
-    fprintf(stdnimp,"SetConsoleMode(%08x,%08lx)\n",hcon,mode);
-    return TRUE;
+	fprintf(stdnimp,"SetConsoleMode(%08x,%08lx)\n",hcon,mode);
+	return TRUE;
 }
 
 /***********************************************************************
@@ -458,8 +474,15 @@
  */
 DWORD WINAPI GetConsoleTitle32A(LPSTR title,DWORD size)
 {
-    lstrcpyn32A(title,"Console",size);
-    return strlen("Console");
+	PDB32 *pdb = PROCESS_Current();
+	CONSOLE *console= (CONSOLE *)pdb->console;
+
+	if(console->title) 
+	  {
+	    lstrcpyn32A(title,console->title,size);
+	    return strlen(title);
+	  }
+	return 0;
 }
 
 /***********************************************************************
@@ -467,8 +490,14 @@
  */
 DWORD WINAPI GetConsoleTitle32W(LPWSTR title,DWORD size)
 {
-    lstrcpynAtoW(title,"Console",size);
-    return strlen("Console");
+	PDB32 *pdb = PROCESS_Current();
+	CONSOLE *console= (CONSOLE *)pdb->console;
+	if(console->title) 
+	  {
+	    lstrcpynAtoW(title,console->title,size);
+	    return (lstrlen32W(title));
+	  }
+	return 0;
 }
 
 /***********************************************************************
@@ -506,10 +535,16 @@
                                LPDWORD lpNumberOfCharsWritten,
                                LPVOID lpReserved )
 {
+        BOOL32 ret;
+        LPSTR xstring=HeapAlloc( GetProcessHeap(), 0, nNumberOfCharsToWrite );
+
+	lstrcpynWtoA( xstring,  lpBuffer,nNumberOfCharsToWrite);
 
 	/* FIXME: should I check if this is a console handle? */
-	return WriteFile(hConsoleOutput, lpBuffer, nNumberOfCharsToWrite,
+	ret= WriteFile(hConsoleOutput, xstring, nNumberOfCharsToWrite,
 			 lpNumberOfCharsWritten, NULL);
+	HeapFree( GetProcessHeap(), 0, xstring );
+	return ret;
 
 }
 
@@ -546,8 +581,15 @@
                               LPDWORD lpNumberOfCharsRead,
                               LPVOID lpReserved )
 {
-	return ReadFile(hConsoleInput, lpBuffer, nNumberOfCharsToRead,
+        BOOL32 ret;
+	LPSTR buf = (LPSTR)HeapAlloc(GetProcessHeap(), 0, 
+				       nNumberOfCharsToRead);
+	ret = ReadFile(hConsoleInput, buf, nNumberOfCharsToRead,
 			lpNumberOfCharsRead, NULL);
+	lstrcpynAtoW(lpBuffer,buf,nNumberOfCharsToRead);
+	*lpNumberOfCharsRead = strlen(buf);
+	HeapFree( GetProcessHeap(), 0, buf );
+	return ret;
 
 #ifdef OLD
 	LPSTR buf = (LPSTR)HEAP_xalloc(GetProcessHeap(), 0, 
@@ -563,8 +605,8 @@
 	lstrcpynAtoW(lpBuffer,buf,nNumberOfCharsToRead);
 	*lpNumberOfCharsRead = strlen(buf);
 	HeapFree( GetProcessHeap(), 0, buf );
-#endif
 	return TRUE;
+#endif
 
 }
 
@@ -573,8 +615,34 @@
  */
 BOOL32 WINAPI SetConsoleTitle32A(LPCSTR title)
 {
-    fprintf(stderr,"SetConsoleTitle(%s)\n",title);
-    return TRUE;
+	PDB32 *pdb = PROCESS_Current();
+	CONSOLE *console;
+	DWORD written;
+	char titleformat[]="\033]2;%s\a"; /*this should work for xterms*/
+	LPSTR titlestring; 
+	BOOL32 ret=FALSE;
+
+	TRACE(console,"SetConsoleTitle(%s)\n",title);
+	
+	console = (CONSOLE *)pdb->console;
+	if (!console)
+	  return FALSE;
+	if(console->title) /* Free old title, if there is one */
+	  HeapFree( SystemHeap, 0, console->title );
+	console->title = (LPSTR)HeapAlloc(SystemHeap, 0,strlen(title)+1);
+	if(console->title) strcpy(console->title,title);
+
+	titlestring = HeapAlloc(GetProcessHeap(), 0,strlen(title)+strlen(titleformat)+1);
+	if (!titlestring)
+	  return FALSE;
+	
+ 	sprintf(titlestring,titleformat,title);
+	/* Ugly casting */
+	CONSOLE_Write((K32OBJ *)console,titlestring,strlen(titlestring),&written,NULL);
+	if (written == strlen(titlestring))
+	  ret =TRUE;
+	HeapFree( GetProcessHeap(), 0, titlestring );
+	return ret;
 }
 
 /***********************************************************************
@@ -582,10 +650,12 @@
  */
 BOOL32 WINAPI SetConsoleTitle32W( LPCWSTR title )
 {
+    BOOL32 ret;
+
     LPSTR titleA = HEAP_strdupWtoA( GetProcessHeap(), 0, title );
-    fprintf(stderr,"SetConsoleTitle(%s)\n",titleA);
+    ret = SetConsoleTitle32A(titleA);
     HeapFree( GetProcessHeap(), 0, titleA );
-    return TRUE;
+    return ret;
 }
 
 /***********************************************************************
@@ -678,3 +748,22 @@
   fprintf (stdnimp, "SetConsoleCursorInfo32 -- STUB!\n");
   return TRUE;
 }
+
+/***********************************************************************
+ *            SetConsoleWindowInfo32   (KERNEL32.634)
+ */
+BOOL32 WINAPI SetConsoleWindowInfo32(HANDLE32 hcon, BOOL32 flag, LPSMALL_RECT window)
+{
+  fprintf (stdnimp, "SetConsoleWindowInfo32-- STUB!\n");
+  return TRUE;
+}
+
+/***********************************************************************
+ *               (KERNEL32.631)
+ */
+BOOL32 WINAPI SetConsoleTextAttribute32(HANDLE32 hcon, DWORD attributes)
+{
+  fprintf (stdnimp, "SetConsoleTextAttribute32-- STUB!\n");
+  return TRUE;
+}
+
diff --git a/win32/except.c b/win32/except.c
index 08cc70d..fedd40b 100644
--- a/win32/except.c
+++ b/win32/except.c
@@ -81,7 +81,7 @@
           (TEB_EXCEPTION_FRAME(pcontext) != ((void *)0xffffffff)) &&
           (TEB_EXCEPTION_FRAME(pcontext) != pEndFrame))
    {
-       dprintf_info(win32, "calling exception handler at 0x%x\n",
+       TRACE(win32, "calling exception handler at 0x%x\n",
                       (int)TEB_EXCEPTION_FRAME(pcontext)->Handler );
 
        dispatch=0;       
@@ -89,7 +89,7 @@
                                                 TEB_EXCEPTION_FRAME(pcontext),
                                                 pcontext, &dispatch);
                                          
-       dprintf_info(win32,"exception handler returns 0x%x, dispatch=0x%x\n",
+       TRACE(win32,"exception handler returns 0x%x, dispatch=0x%x\n",
                               retval, (int) dispatch);
   
        if (	(retval == ExceptionCollidedUnwind) &&
@@ -149,14 +149,14 @@
     
     while((pframe!=NULL)&&(pframe!=((void *)0xFFFFFFFF)))
     {
-       dprintf_info(win32,"calling exception handler at 0x%x\n",
+       TRACE(win32,"calling exception handler at 0x%x\n",
                                                 (int) pframe->Handler);
        dispatch=0;  
-       dprintf_info(relay,"CallTo32(except=%p,record=%p,frame=%p,context=%p,dispatch=%p)\n",
+       TRACE(relay,"(except=%p,record=%p,frame=%p,context=%p,dispatch=%p)\n",
                      pframe->Handler, &record, pframe, pcontext, &dispatch );
        retval=pframe->Handler(&record,pframe,pcontext,&dispatch);
  
-       dprintf_info(win32,"exception handler returns 0x%x, dispatch=0x%x\n",
+       TRACE(win32,"exception handler returns 0x%x, dispatch=0x%x\n",
                               retval, (int) dispatch);
                               
        if(retval==ExceptionContinueExecution)
@@ -167,7 +167,7 @@
    if (retval!=ExceptionContinueExecution)
    {    
        /* FIXME: what should we do here? */
-       dprintf_info(win32,"no handler wanted to handle the exception, exiting\n");
+       TRACE(win32,"no handler wanted to handle the exception, exiting\n");
        ExitProcess(dwExceptionCode); /* what status should be used here ? */
    }
 }
diff --git a/win32/file.c b/win32/file.c
index 85ea01f..86a953e 100644
--- a/win32/file.c
+++ b/win32/file.c
@@ -37,8 +37,8 @@
 	K32OBJ *ioptr;
 	BOOL32 status = FALSE;
 	
-	dprintf_info(file, "WriteFile: %d %p %ld\n", hFile, lpBuffer, 
-		      numberOfBytesToWrite);
+	TRACE(file, "%d %p %ld\n", hFile, lpBuffer, 
+		     numberOfBytesToWrite);
 	
 	if (!(ioptr = HANDLE_GetObjPtr( hFile, K32OBJ_UNKNOWN, 0 ))) 
 		return HFILE_ERROR32;
@@ -58,8 +58,8 @@
 	K32OBJ *ioptr;
 	BOOL32 status = FALSE;
 	
-	dprintf_info(file, "ReadFile: %d %p %ld\n", hFile, lpBuffer, 
-		      numberOfBytesToRead);
+	TRACE(file, "%d %p %ld\n", hFile, lpBuffer, 
+		     numberOfBytesToRead);
 	
 	if (!(ioptr = HANDLE_GetObjPtr( hFile, K32OBJ_UNKNOWN, 0 ))) 
 		return HFILE_ERROR32;
@@ -112,7 +112,7 @@
     create_flags = TranslateCreationFlags(creation);
 
     if(template)
-        dprintf_fixme(file, "CreateFile: template handles not supported.\n");
+        FIXME(file, "template handles not supported.\n");
 
     /* If the name starts with '\\?' or '\\.', ignore the first 3 chars.
      */
@@ -123,7 +123,7 @@
      */
     if(!strncmp(filename, "\\\\", 2))
     {
-        dprintf_fixme(file, "CreateFile: UNC names not supported.\n");
+        FIXME(file, "UNC names not supported.\n");
         SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
         return HFILE_ERROR32;
     }
@@ -225,7 +225,7 @@
     if (!DOSFS_GetFullName( lpFileName, TRUE, &full_name ))
         return FALSE;
 
-    dprintf_info(file,"SetFileAttributes(%s,%lx)\n",lpFileName,attributes);
+    TRACE(file,"(%s,%lx)\n",lpFileName,attributes);
     if (attributes & FILE_ATTRIBUTE_NORMAL) {
       attributes &= ~FILE_ATTRIBUTE_NORMAL;
       if (attributes)
diff --git a/win32/init.c b/win32/init.c
index 1472cc0..0b61153 100644
--- a/win32/init.c
+++ b/win32/init.c
@@ -82,7 +82,10 @@
   char *name;
 
   name=getlogin();
+#if 0
+  /* FIXME: should use getpwuid() here */
   if (!name) name=cuserid(NULL);
+#endif
   len = name ? strlen(name) : 0;
   if (!len || !lpSize || len > *lpSize) {
     if (lpszName) *lpszName = 0;
diff --git a/win32/kernel32.c b/win32/kernel32.c
index b1dd942..7eecb23 100644
--- a/win32/kernel32.c
+++ b/win32/kernel32.c
@@ -103,16 +103,16 @@
 	SEGPTR		thkbuf;
 	struct	thunkstruct	*ths16;
 
-	dprintf_info(thunk,"ThunkConnect32(<struct>,%s,%s,%s,%x,%lx)\n",
+	TRACE(thunk,"(<struct>,%s,%s,%s,%x,%lx)\n",
 		thunkfun16,module32,module16,hmod32,dllinitarg1
 	);
-	dprintf_info(thunk,"	magic = %c%c%c%c\n",
+	TRACE(thunk,"	magic = %c%c%c%c\n",
 		ths->magic[0],
 		ths->magic[1],
 		ths->magic[2],
 		ths->magic[3]
 	);
-	dprintf_info(thunk,"	length = %lx\n",ths->length);
+	TRACE(thunk,"	length = %lx\n",ths->length);
 	if (lstrncmp32A(ths->magic,"SL01",4)&&lstrncmp32A(ths->magic,"LS01",4))
 		return 0;
 	hmm=LoadModule16(module16,NULL);
@@ -130,7 +130,7 @@
 			return 0;
 		ths->x0C = (DWORD)ths16;
 
-		dprintf_info(thunk,"	ths16 magic is 0x%08lx\n",*(DWORD*)ths16->magic);
+		TRACE(thunk,"	ths16 magic is 0x%08lx\n",*(DWORD*)ths16->magic);
 		if (*((DWORD*)ths16->magic) != 0x0000304C)
 			return 0;
 		if (!*(WORD*)(((LPBYTE)ths16)+0x12))
@@ -187,9 +187,9 @@
 DWORD WINAPI WOWCallback16(FARPROC16 fproc,DWORD arg)
 {
 	DWORD	ret;
-	dprintf_info(thunk,"WOWCallback16(%p,0x%08lx)...\n",fproc,arg);
+	TRACE(thunk,"(%p,0x%08lx)...\n",fproc,arg);
 	ret =  Callbacks->CallWOWCallbackProc(fproc,arg);
-	dprintf_info(thunk,"... returns %ld\n",ret);
+	TRACE(thunk,"... returns %ld\n",ret);
 	return ret;
 }
 
@@ -212,7 +212,7 @@
 {
 	HMODULE32	hmod = LoadLibrary16("systhunk.dll");
 
-	dprintf_info(thunk, "_KERNEL32_52: systhunk.dll module %d\n", hmod);
+	TRACE(thunk, "systhunk.dll module %d\n", hmod);
 	
 	if (hmod<=32)
 		return 0;
@@ -239,25 +239,27 @@
 
 	hmod = LoadLibrary16(dll16);
 	if (hmod<32) {
-		fprintf(stderr,"KERNEL32_43->failed to load 16bit DLL %s, error %d\n",dll16,hmod);
+		WARN(thunk,"failed to load 16bit DLL %s, error %d\n",
+			     dll16,hmod);
 		return 0;
 	}
 	segaddr = (DWORD)WIN32_GetProcAddress16(hmod,(LPSTR)thkbuf);
 	if (!segaddr) {
-		fprintf(stderr,"KERNEL32_43->no %s exported from %s!\n",thkbuf,dll16);
+	        WARN(thunk,"no %s exported from %s!\n",thkbuf,dll16);
 		return 0;
 	}
 	addr = (LPDWORD)PTR_SEG_TO_LIN(segaddr);
 	if (addr[0] != len) {
-		fprintf(stderr,"KERNEL32_43->thkbuf length mismatch? %ld vs %ld\n",len,addr[0]);
+		WARN(thunk,"thkbuf length mismatch? %ld vs %ld\n",len,addr[0]);
 		return 0;
 	}
 	if (!addr[1])
 		return 0;
 	*(DWORD*)thunk = addr[1];
 
-	dprintf_info(thunk, "_KERNEL32_43: loaded module %d, func %s (%d) @ %p (%p), returning %p\n",
-		      hmod, HIWORD(thkbuf)==0 ? "<ordinal>" : thkbuf, (int)thkbuf, (void*)segaddr, addr, (void*)addr[1]);
+	TRACE(thunk, "loaded module %d, func %s (%d) @ %p (%p), returning %p\n",
+		     hmod, HIWORD(thkbuf)==0 ? "<ordinal>" : thkbuf, (int)thkbuf, 
+		     (void*)segaddr, addr, (void*)addr[1]);
 
 	return addr[1];
 }
@@ -277,11 +279,11 @@
         DWORD ret,stacksize;
 	THDB *thdb = THREAD_Current();
 
-	dprintf_info(thunk,"KERNEL32_45(%%eax=0x%08lx(%%cx=0x%04lx,%%edx=0x%08lx))\n",
+	TRACE(thunk,"(%%eax=0x%08lx(%%cx=0x%04lx,%%edx=0x%08lx))\n",
 		(DWORD)EAX_reg(context),(DWORD)CX_reg(context),(DWORD)EDX_reg(context)
 	);
 	stacksize = EBP_reg(context)-ESP_reg(context);
-	dprintf_info(thunk,"	stacksize = %ld\n",stacksize);
+	TRACE(thunk,"	stacksize = %ld\n",stacksize);
 
 	memcpy(&context16,context,sizeof(context16));
 
@@ -294,7 +296,7 @@
 	ret = Callbacks->CallRegisterLongProc(&context16,0);
 	STACK16_POP( thdb, stacksize );
 
-	dprintf_info(thunk,". returned %08lx\n",ret);
+	TRACE(thunk,". returned %08lx\n",ret);
 	EAX_reg(context) 	 = ret;
 }
 
@@ -312,12 +314,11 @@
 	DWORD	ret,stacksize;
 	THDB *thdb = THREAD_Current();
 
-	dprintf_info(thunk,"_KERNEL32_40(EDX=0x%08lx)\n",
-		EDX_reg(context)
-	);
+	__RESTORE_ES;
+	TRACE(thunk,"(EDX=0x%08lx)\n", EDX_reg(context) );
 	stacksize = EBP_reg(context)-ESP_reg(context);
-	dprintf_info(thunk,"	stacksize = %ld\n",stacksize);
-	dprintf_info(thunk,"on top of stack: 0x%04x\n",*(WORD*)ESP_reg(context));
+	TRACE(thunk,"	stacksize = %ld\n",stacksize);
+	TRACE(thunk,"on top of stack: 0x%04x\n",*(WORD*)ESP_reg(context));
 
 	memcpy(&context16,context,sizeof(context16));
 
@@ -329,7 +330,7 @@
 	ret = Callbacks->CallRegisterShortProc(&context16,0);
 	STACK16_POP( thdb, stacksize );
 
-	dprintf_info(thunk,". returned %08lx\n",ret);
+	TRACE(thunk,". returned %08lx\n",ret);
 	EAX_reg(context) 	 = ret;
 }
 
@@ -387,25 +388,27 @@
 	
 	hmod = LoadLibrary16(dll16);
 	if (hmod<32) {
-		fprintf(stderr,"KERNEL32_41->failed to load 16bit DLL %s, error %d\n",dll16,hmod);
+		WARN(thunk,"failed to load 16bit DLL %s, error %d\n",
+			     dll16,hmod);
 		return NULL;
 	}
 	segaddr = (DWORD)WIN32_GetProcAddress16(hmod,(LPSTR)thkbuf);
 	if (!segaddr) {
-		fprintf(stderr,"KERNEL32_41->no %s exported from %s!\n",thkbuf,dll16);
+		WARN(thunk,"no %s exported from %s!\n",thkbuf,dll16);
 		return NULL;
 	}
 	addr = (LPDWORD)PTR_SEG_TO_LIN(segaddr);
 	if (addr[0] != len) {
-		fprintf(stderr,"KERNEL32_41->thkbuf length mismatch? %ld vs %ld\n",len,addr[0]);
+		WARN(thunk,"thkbuf length mismatch? %ld vs %ld\n",len,addr[0]);
 		return NULL;
 	}
 	addr2 = PTR_SEG_TO_LIN(addr[1]);
 	if (HIWORD(addr2))
 		*(DWORD*)thunk = (DWORD)addr2;
 
-	dprintf_info(thunk, "_KERNEL32_41: loaded module %d, func %s(%d) @ %p (%p), returning %p\n",
-		      hmod, HIWORD(thkbuf)==0 ? "<ordinal>" : thkbuf, (int)thkbuf, (void*)segaddr, addr, addr2);
+	TRACE(thunk, "loaded module %d, func %s(%d) @ %p (%p), returning %p\n",
+		      hmod, HIWORD(thkbuf)==0 ? "<ordinal>" : thkbuf, (int)thkbuf, 
+		     (void*)segaddr, addr, addr2);
 
 	return addr2;
 }
@@ -419,7 +422,7 @@
  */
 VOID WINAPI _KERNEL32_90(CONTEXT *context)
 {
-	dprintf_info(thunk, "_KERNEL32_90: QT Thunk priming; context %p\n", context);
+	TRACE(thunk, "QT Thunk priming; context %p\n", context);
 	
 	_write_qtthunk((LPBYTE)EAX_reg(context),*(DWORD*)(EAX_reg(context)+EDX_reg(context)));
 	/* we just call the real QT_Thunk right now 
@@ -446,23 +449,25 @@
 
 	hmod = LoadLibrary16(dll16);
 	if (hmod < 32) {
-		fprintf(stderr,"KERNEL32_46->couldn't load %s, error %d\n",dll16,hmod);
+		WARN(thunk,"couldn't load %s, error %d\n",dll16,hmod);
 		return;
 	}
 	segaddr = (SEGPTR)WIN32_GetProcAddress16(hmod,thkbuf);
 	if (!segaddr) {
-		fprintf(stderr,"KERNEL32_46-> haven't found %s in %s!\n",thkbuf,dll16);
+		WARN(thunk,"haven't found %s in %s!\n",thkbuf,dll16);
 		return;
 	}
 	addr = (LPDWORD)PTR_SEG_TO_LIN(segaddr);
 	if (addr[0] != len) {
-		fprintf(stderr,"KERNEL32_46-> length of thkbuf differs from expected length! (%ld vs %ld)\n",addr[0],len);
+	        WARN(thunk,"length of thkbuf differs from expected length! "
+			     "(%ld vs %ld)\n",addr[0],len);
 		return;
 	}
 	*(DWORD*)PTR_SEG_TO_LIN(addr[1]) = (DWORD)thunk;
 
-	dprintf_info(thunk, "_KERNEL32_46: loaded module %d, func %s(%d) @ %p (%p)\n",
-		      hmod, HIWORD(thkbuf)==0 ? "<ordinal>" : thkbuf, (int)thkbuf, (void*)segaddr, addr);
+	TRACE(thunk, "loaded module %d, func %s(%d) @ %p (%p)\n",
+		     hmod, HIWORD(thkbuf)==0 ? "<ordinal>" : thkbuf, 
+		     (int)thkbuf, (void*)segaddr, addr);
 }
 
 /**********************************************************************
@@ -473,7 +478,7 @@
  */
 BOOL32 WINAPI _KERNEL32_87()
 {
-    dprintf_info(thunk, "_KERNEL32_87: Yes, thunking is initialized\n");
+    TRACE(thunk, "Yes, thunking is initialized\n");
     return TRUE;
 }
 
@@ -490,11 +495,11 @@
     DWORD i,ret;
     DWORD *args = ((DWORD *)&fun) + 1;
 
-    if(debugging_info(thunk)){
+    if(TRACE_ON(thunk)){
       dbg_decl_str(thunk, 256);
       for (i=0;i<nr/4;i++) 
 	dsprintf(thunk,"0x%08lx,",args[i]);
-      dprintf_info(thunk,"KERNEL32_88(%ld,0x%08lx,%p,[%s])\n",
+      TRACE(thunk,"(%ld,0x%08lx,%p,[%s])\n",
 		    nr,flags,fun,dbg_str(thunk));
     }
     switch (nr) {
@@ -530,7 +535,7 @@
 	break;
 
     }
-    dprintf_info(thunk," returning %ld ...\n",ret);
+    TRACE(thunk," returning %ld ...\n",ret);
     return ret;
 }
 
diff --git a/win32/process.c b/win32/process.c
index c4571ab..2326f9f 100644
--- a/win32/process.c
+++ b/win32/process.c
@@ -50,7 +50,7 @@
                                      LPDWORD lpProcessAffinityMask,
                                      LPDWORD lpSystemAffinityMask)
 {
-	dprintf_info(task,"GetProcessAffinityMask(%x,%lx,%lx)\n",
+	TRACE(task,"(%x,%lx,%lx)\n",
 		hProcess,(lpProcessAffinityMask?*lpProcessAffinityMask:0),
 		(lpSystemAffinityMask?*lpSystemAffinityMask:0));
 	/* It is definitely important for a process to know on what processor
diff --git a/win32/thread.c b/win32/thread.c
index e3d8e71..ff0b824 100644
--- a/win32/thread.c
+++ b/win32/thread.c
@@ -104,11 +104,17 @@
 }
 
 /************************************************************************
-*           InterlockedExchange				[KERNEL32]	*
-************************************************************************/
-
-LONG WINAPI InterlockedExchange(LPLONG target, LONG value)
-{
+ *           InterlockedExchange				[KERNEL32.???]
+ *
+ * Atomically exchanges a pair of values.
+ *
+ * RETURNS
+ *	Prior value of value pointed to by Target
+ */
+LONG WINAPI InterlockedExchange(
+	    LPLONG target, /* Address of 32-bit value to exchange */
+	    LONG value     /* New value for the value pointed to by target */
+) {
 #if defined(__i386__)&&defined(__GNUC__)	
 	LONG ret;
 	__asm__ ( /* lock for SMP systems */
diff --git a/win32/time.c b/win32/time.c
index 333ab7f..fd53a3e 100644
--- a/win32/time.c
+++ b/win32/time.c
@@ -140,3 +140,10 @@
         while(1) sleep(1000); /* Spin forever */
     usleep(cMilliseconds*1000);
 }
+
+/***********************************************************************
+ *              GetSystemTimeAsFileTime  (KERNEL32)
+ */
+VOID WINAPI GetSystemTimeAsFileTime(LPFILETIME systemtimeAsfiletime) {
+	DOSFS_UnixTimeToFileTime(time(NULL),systemtimeAsfiletime,NULL);
+}
diff --git a/windows/caret.c b/windows/caret.c
index 50e326b..e06e304 100644
--- a/windows/caret.c
+++ b/windows/caret.c
@@ -77,7 +77,7 @@
  */
 static VOID CARET_Callback( HWND32 hwnd, UINT32 msg, UINT32 id, DWORD ctime)
 {
-    dprintf_info(caret,"CARET_Callback: hwnd=%04x, timerid=%d, caret=%d\n",
+    TRACE(caret,"hwnd=%04x, timerid=%d, caret=%d\n",
                   hwnd, id, Caret.on);
     CARET_DisplayCaret(CARET_TOGGLE);
 }
@@ -136,7 +136,7 @@
 BOOL32 WINAPI CreateCaret32( HWND32 hwnd, HBITMAP32 bitmap,
                              INT32 width, INT32 height )
 {
-    dprintf_info(caret,"CreateCaret: hwnd=%04x\n", hwnd);
+    TRACE(caret,"hwnd=%04x\n", hwnd);
 
     if (!hwnd) return FALSE;
 
@@ -188,7 +188,7 @@
 {
     if (!Caret.hwnd) return FALSE;
 
-    dprintf_info(caret,"DestroyCaret: hwnd=%04x, timerid=%d\n",
+    TRACE(caret,"hwnd=%04x, timerid=%d\n",
 		Caret.hwnd, Caret.timerid);
 
     CARET_KillTimer();
@@ -216,7 +216,7 @@
     if (!Caret.hwnd) return FALSE;
     if ((x == Caret.x) && (y == Caret.y)) return TRUE;
 
-    dprintf_info(caret,"SetCaretPos: x=%d, y=%d\n", x, y);
+    TRACE(caret,"x=%d, y=%d\n", x, y);
 
     CARET_KillTimer();
     CARET_DisplayCaret(CARET_OFF);
@@ -248,7 +248,7 @@
     if (!Caret.hwnd) return FALSE;
     if (hwnd && (Caret.hwnd != hwnd)) return FALSE;
 
-    dprintf_info(caret,"HideCaret: hwnd=%04x, hidden=%d\n",
+    TRACE(caret,"hwnd=%04x, hidden=%d\n",
                   hwnd, Caret.hidden);
 
     CARET_KillTimer();
@@ -275,7 +275,7 @@
     if (!Caret.hwnd) return FALSE;
     if (hwnd && (Caret.hwnd != hwnd)) return FALSE;
 
-    dprintf_info(caret,"ShowCaret: hwnd=%04x, hidden=%d\n",
+    TRACE(caret,"hwnd=%04x, hidden=%d\n",
 		hwnd, Caret.hidden);
 
     if (Caret.hidden)
@@ -306,7 +306,7 @@
 {
     if (!Caret.hwnd) return FALSE;
 
-    dprintf_info(caret,"SetCaretBlinkTime: hwnd=%04x, msecs=%d\n",
+    TRACE(caret,"hwnd=%04x, msecs=%d\n",
 		Caret.hwnd, msecs);
 
     Caret.timeout = msecs;
@@ -340,7 +340,7 @@
 {
     if (!Caret.hwnd || !pt) return;
 
-    dprintf_info(caret,"GetCaretPos: hwnd=%04x, pt=%p, x=%d, y=%d\n",
+    TRACE(caret,"hwnd=%04x, pt=%p, x=%d, y=%d\n",
                   Caret.hwnd, pt, Caret.x, Caret.y);
     pt->x = (INT16)Caret.x;
     pt->y = (INT16)Caret.y;
diff --git a/windows/class.c b/windows/class.c
index f9355c8..dbf9154 100644
--- a/windows/class.c
+++ b/windows/class.c
@@ -317,7 +317,7 @@
         return 0;
     }
 
-    dprintf_info(class, "RegisterClass16: atom=%04x wndproc=%08lx hinst=%04x
+    TRACE(class, "atom=%04x wndproc=%08lx hinst=%04x
 bg=%04x style=%08x clsExt=%d winExt=%d class=%p name='%s'\n",
                    atom, (DWORD)wc->lpfnWndProc, hInstance,
                    wc->hbrBackground, wc->style, wc->cbClsExtra,
@@ -338,9 +338,13 @@
 
 /***********************************************************************
  *           RegisterClass32A      (USER32.426)
+ * RETURNS
+ *	>0: Unique identifier
+ *	0: Failure
  */
-ATOM WINAPI RegisterClass32A( const WNDCLASS32A* wc )
-{
+ATOM WINAPI RegisterClass32A(
+	    const WNDCLASS32A* wc /* Address of structure with class data */
+) {
     ATOM atom;
     CLASS *classPtr;
 
@@ -354,7 +358,7 @@
         return 0;
     }
 
-    dprintf_info(class, "RegisterClass32A: atom=%04x wndproc=%08lx
+    TRACE(class, "atom=%04x wndproc=%08lx
 hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p name='%s'\n",
                    atom, (DWORD)wc->lpfnWndProc, wc->hInstance,
                    wc->hbrBackground, wc->style, wc->cbClsExtra,
@@ -388,7 +392,7 @@
         return 0;
     }
 
-    dprintf_info(class, "RegisterClass32W: atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
+    TRACE(class, "atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
                    atom, (DWORD)wc->lpfnWndProc, wc->hInstance,
                    wc->hbrBackground, wc->style, wc->cbClsExtra,
                    wc->cbWndExtra, classPtr );
@@ -420,7 +424,7 @@
         return 0;
     }
 
-    dprintf_info(class, "RegisterClassEx16: atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
+    TRACE(class, "atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
                    atom, (DWORD)wc->lpfnWndProc, hInstance,
                    wc->hbrBackground, wc->style, wc->cbClsExtra,
                    wc->cbWndExtra, classPtr );
@@ -454,7 +458,7 @@
         return 0;
     }
 
-    dprintf_info(class, "RegisterClassEx32A: atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
+    TRACE(class, "atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
                    atom, (DWORD)wc->lpfnWndProc, wc->hInstance,
                    wc->hbrBackground, wc->style, wc->cbClsExtra,
                    wc->cbWndExtra, classPtr );
@@ -486,7 +490,7 @@
         return 0;
     }
 
-    dprintf_info(class, "RegisterClassEx32W: atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
+    TRACE(class, "atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
                    atom, (DWORD)wc->lpfnWndProc, wc->hInstance,
                    wc->hbrBackground, wc->style, wc->cbClsExtra,
                    wc->cbWndExtra, classPtr );
diff --git a/windows/clipboard.c b/windows/clipboard.c
index 393bed5..5c515d3 100644
--- a/windows/clipboard.c
+++ b/windows/clipboard.c
@@ -92,7 +92,7 @@
  */
 static void CLIPBOARD_CheckSelection(WND* pWnd)
 {
-    dprintf_info(clipboard,"\tchecking %08x\n", (unsigned)pWnd->window);
+    TRACE(clipboard,"\tchecking %08x\n", (unsigned)pWnd->window);
 
     if( selectionAcquired && selectionWindow != None &&
         pWnd->window == selectionWindow )
@@ -106,7 +106,7 @@
              if( pWnd->parent->child != pWnd ) 
                  selectionWindow = pWnd->parent->child->window;
 
-	dprintf_info(clipboard,"\tswitching selection from %08x to %08x\n", 
+	TRACE(clipboard,"\tswitching selection from %08x to %08x\n", 
                     (unsigned)selectionPrevWindow, (unsigned)selectionWindow);
 
 	if( selectionWindow != None )
@@ -146,7 +146,7 @@
 {
     LPCLIPFORMAT lpFormat = ClipFormats;
 
-    dprintf_info(clipboard,"DisOwn: clipboard owner = %04x, selection = %08x\n", 
+    TRACE(clipboard,"clipboard owner = %04x, selection = %08x\n", 
 				hWndClipOwner, (unsigned)selectionWindow);
 
     if( pWnd->hwndSelf == hWndClipOwner)
@@ -159,7 +159,7 @@
 	{
 	    if( lpFormat->wDataPresent && !lpFormat->hData )
 	    {
-		dprintf_info(clipboard,"\tdata missing for clipboard format %i\n", 
+		TRACE(clipboard,"\tdata missing for clipboard format %i\n", 
 				   lpFormat->wFormatID); 
 		lpFormat->wDataPresent = 0;
 	    }
@@ -204,7 +204,7 @@
 
     if( !hWnd ) return FALSE;
 
-    dprintf_info(clipboard,"Requesting selection...\n");
+    TRACE(clipboard,"Requesting selection...\n");
 
   /* request data type XA_STRING, later
    * CLIPBOARD_ReadSelection() will be invoked 
@@ -224,7 +224,7 @@
     while(selectionWait) EVENT_WaitNetEvent( TRUE, FALSE );
 
   /* we treat Unix text as CF_OEMTEXT */
-    dprintf_info(clipboard,"\tgot CF_OEMTEXT = %i\n", 
+    TRACE(clipboard,"\tgot CF_OEMTEXT = %i\n", 
 		      ClipFormats[CF_OEMTEXT-1].wDataPresent);
 
     return (BOOL32)ClipFormats[CF_OEMTEXT-1].wDataPresent;
@@ -266,7 +266,7 @@
 {
     BOOL32 bRet;
 
-    dprintf_info(clipboard,"OpenClipboard(%04x)...\n", hWnd);
+    TRACE(clipboard,"(%04x)...\n", hWnd);
 
     if (!hqClipLock)
     {
@@ -277,7 +277,7 @@
     }
     else bRet = FALSE;
 
-    dprintf_info(clipboard,"   returning %i\n", bRet);
+    TRACE(clipboard,"   returning %i\n", bRet);
     return bRet;
 }
 
@@ -296,7 +296,7 @@
  */
 BOOL32 WINAPI CloseClipboard32(void)
 {
-    dprintf_info(clipboard,"CloseClipboard(); !\n");
+    TRACE(clipboard,"!\n");
 
     if (hqClipLock == GetTaskQueue(0))
     {
@@ -326,7 +326,7 @@
 {
     LPCLIPFORMAT lpFormat = ClipFormats; 
 
-    dprintf_info(clipboard,"EmptyClipboard()\n");
+    TRACE(clipboard,"(void)\n");
 
     if (hqClipLock != GetTaskQueue(0)) return FALSE;
 
@@ -351,7 +351,7 @@
 	selectionPrevWindow 	= selectionWindow;
 	selectionWindow 	= None;
 
-	dprintf_info(clipboard, "\tgiving up selection (spw = %08x)\n", 
+	TRACE(clipboard, "\tgiving up selection (spw = %08x)\n", 
 				 	(unsigned)selectionPrevWindow);
 
 	TSXSetSelectionOwner(display, XA_PRIMARY, None, CurrentTime);
@@ -386,8 +386,7 @@
     LPCLIPFORMAT lpFormat = __lookup_format( ClipFormats, wFormat );
     Window       owner;
 
-    dprintf_info(clipboard,
-		"SetClipboardData(%04X, %04x) !\n", wFormat, hData);
+    TRACE(clipboard, "(%04X, %04x) !\n", wFormat, hData);
 
     /* NOTE: If the hData is zero and current owner doesn't match
      * the window that opened the clipboard then this application
@@ -411,7 +410,7 @@
 	    selectionAcquired = True;
 	    selectionWindow = owner;
 
-	    dprintf_info(clipboard,"Grabbed X selection, owner=(%08x)\n", 
+	    TRACE(clipboard,"Grabbed X selection, owner=(%08x)\n", 
 						(unsigned) owner);
 	}
     }
@@ -459,7 +458,7 @@
                      (WPARAM16)lpFormat->wFormatID,0L);
    else
    {
-       dprintf_warn(clipboard, "\thWndClipOwner (%04x) is lost!\n", 
+       WARN(clipboard, "\thWndClipOwner (%04x) is lost!\n", 
                                       hWndClipOwner);
        hWndClipOwner = 0; lpFormat->wDataPresent = 0;
        return FALSE;
@@ -479,7 +478,7 @@
     LPSTR  lpstrT;
 
     if( !lpstrS ) return FALSE;
-    dprintf_info(clipboard,"\tconverting from '%s' to '%s', %i chars\n",
+    TRACE(clipboard,"\tconverting from '%s' to '%s', %i chars\n",
 			   	      lpSource->Name, lpTarget->Name, size);
 
     lpTarget->hData = GlobalAlloc16(GMEM_ZEROINIT, size); 
@@ -491,7 +490,7 @@
 	    CharToOemBuff32A(lpstrS, lpstrT, size);
 	else
 	    OemToCharBuff32A(lpstrS, lpstrT, size);
-	dprintf_info(clipboard,"\tgot %s\n", lpstrT);
+	TRACE(clipboard,"\tgot %s\n", lpstrT);
 	return TRUE;
     }
 
@@ -509,7 +508,7 @@
 
     if (hqClipLock != GetTaskQueue(0)) return 0;
 
-    dprintf_info(clipboard,"GetClipboardData(%04X)\n", wFormat);
+    TRACE(clipboard,"(%04X)\n", wFormat);
 
     if( wFormat == CF_TEXT && !lpRender[CF_TEXT-1].wDataPresent 
 			   &&  lpRender[CF_OEMTEXT-1].wDataPresent )
@@ -517,7 +516,7 @@
 	lpRender = &ClipFormats[CF_OEMTEXT-1];
 	lpUpdate = &ClipFormats[CF_TEXT-1];
 
-	dprintf_info(clipboard,"\tOEMTEXT -> TEXT\n");
+	TRACE(clipboard,"\tOEMTEXT -> TEXT\n");
     }
     else if( wFormat == CF_OEMTEXT && !lpRender[CF_OEMTEXT-1].wDataPresent
 				   &&  lpRender[CF_TEXT-1].wDataPresent )
@@ -525,7 +524,7 @@
         lpRender = &ClipFormats[CF_TEXT-1];
 	lpUpdate = &ClipFormats[CF_OEMTEXT-1];
 	
-	dprintf_info(clipboard,"\tTEXT -> OEMTEXT\n");
+	TRACE(clipboard,"\tTEXT -> OEMTEXT\n");
     }
     else
     {
@@ -537,7 +536,7 @@
     if( lpUpdate != lpRender && !lpUpdate->hData ) 
 	CLIPBOARD_RenderText(lpUpdate, lpRender);
 
-    dprintf_info(clipboard,"\treturning %04x (type %i)\n", 
+    TRACE(clipboard,"\treturning %04x (type %i)\n", 
 			      lpUpdate->hData, lpUpdate->wFormatID);
     return lpUpdate->hData;
 }
@@ -569,7 +568,7 @@
     INT32 FormatCount = 0;
     LPCLIPFORMAT lpFormat = ClipFormats; 
 
-    dprintf_info(clipboard,"CountClipboardFormats()\n");
+    TRACE(clipboard,"(void)\n");
 
     if( !selectionAcquired ) CLIPBOARD_RequestXSelection();
 
@@ -581,13 +580,13 @@
 	if (lpFormat == NULL) break;
 	if (lpFormat->wDataPresent) 
 	{
-            dprintf_info(clipboard, "\tdata found for format %i\n", lpFormat->wFormatID);
+            TRACE(clipboard, "\tdata found for format %i\n", lpFormat->wFormatID);
 	    FormatCount++;
 	}
 	lpFormat = lpFormat->NextFormat;
     }
 
-    dprintf_info(clipboard,"\ttotal %d\n", FormatCount);
+    TRACE(clipboard,"\ttotal %d\n", FormatCount);
     return FormatCount;
 }
 
@@ -608,7 +607,7 @@
 {
     LPCLIPFORMAT lpFormat = ClipFormats; 
 
-    dprintf_info(clipboard,"EnumClipboardFormats(%04X)\n", wFormat);
+    TRACE(clipboard,"(%04X)\n", wFormat);
 
     if( hqClipLock != GetTaskQueue(0) ) return 0;
 
@@ -651,7 +650,7 @@
 
     if (FormatName == NULL) return 0;
 
-    dprintf_info(clipboard,"RegisterClipboardFormat('%s') !\n", FormatName);
+    TRACE(clipboard,"('%s') !\n", FormatName);
 
     /* walk format chain to see if it's already registered */
 
@@ -724,14 +723,12 @@
 {
     LPCLIPFORMAT lpFormat = __lookup_format( ClipFormats, wFormat );
 
-    dprintf_info(clipboard,
-	"GetClipboardFormatName(%04X, %p, %d) !\n", wFormat, retStr, maxlen);
+    TRACE(clipboard, "(%04X, %p, %d) !\n", wFormat, retStr, maxlen);
 
     if (lpFormat == NULL || lpFormat->Name == NULL || 
 	lpFormat->wFormatID < CF_REGFORMATBASE) return 0;
 
-    dprintf_info(clipboard,
-		"GetClipboardFormat // Name='%s' !\n", lpFormat->Name);
+    TRACE(clipboard, "Name='%s' !\n", lpFormat->Name);
 
     lstrcpyn32A( retStr, lpFormat->Name, maxlen );
     return strlen(retStr);
@@ -767,7 +764,7 @@
 {
     HWND32 hwndPrev = hWndViewer;
 
-    dprintf_info(clipboard,"SetClipboardViewer(%04x): returning %04x\n", hWnd, hwndPrev);
+    TRACE(clipboard,"(%04x): returning %04x\n", hWnd, hwndPrev);
 
     hWndViewer = hWnd;
     return hwndPrev;
@@ -807,14 +804,14 @@
 {
     BOOL32 bRet = 0;
 
-    dprintf_fixme(clipboard, "ChangeClipboardChain(%04x, %04x) - stub?\n", 
+    FIXME(clipboard, "(%04x, %04x) - stub?\n", 
 		      hWnd, hWndNext);
 
     if( hWndViewer )
 	bRet = !SendMessage16( hWndViewer, WM_CHANGECBCHAIN,
                              (WPARAM16)hWnd, (LPARAM)hWndNext);   
     else
-	dprintf_warn(clipboard, "ChangeClipboardChain: hWndViewer is lost\n");
+	WARN(clipboard, "hWndViewer is lost\n");
 
     if( hWnd == hWndViewer ) hWndViewer = hWndNext;
 
@@ -837,7 +834,7 @@
  */
 BOOL32 WINAPI IsClipboardFormatAvailable32( UINT32 wFormat )
 {
-    dprintf_info(clipboard,"IsClipboardFormatAvailable(%04X) !\n", wFormat);
+    TRACE(clipboard,"(%04X) !\n", wFormat);
 
     if( (wFormat == CF_TEXT || wFormat == CF_OEMTEXT) &&
         !selectionAcquired ) CLIPBOARD_RequestXSelection();
@@ -907,7 +904,7 @@
     HANDLE16 	 hText = 0;
     LPCLIPFORMAT lpFormat = ClipFormats; 
 
-    dprintf_info(clipboard,"ReadSelection callback\n");
+    TRACE(clipboard,"ReadSelection callback\n");
 
     if(prop != None)
     {
@@ -916,16 +913,16 @@
 	unsigned long 	nitems,remain;
 	unsigned char*	val=NULL;
 
-        dprintf_info(clipboard,"\tgot property %s\n",TSXGetAtomName(display,prop));
+        TRACE(clipboard,"\tgot property %s\n",TSXGetAtomName(display,prop));
 
         /* TODO: Properties longer than 64K */
 
 	if(TSXGetWindowProperty(display,w,prop,0,0x3FFF,True,XA_STRING,
 	    &atype, &aformat, &nitems, &remain, &val) != Success)
-	    dprintf_warn(clipboard, "\tcouldn't read property\n");
+	    WARN(clipboard, "\tcouldn't read property\n");
 	else
 	{
-           dprintf_info(clipboard,"\tType %s,Format %d,nitems %ld,value %s\n",
+           TRACE(clipboard,"\tType %s,Format %d,nitems %ld,value %s\n",
 		             TSXGetAtomName(display,atype),aformat,nitems,val);
 
 	   if(atype == XA_STRING && aformat == 8)
@@ -933,7 +930,7 @@
 	      int 	i,inlcount = 0;
 	      char*	lpstr;
 
-	      dprintf_info(clipboard,"\tselection is '%s'\n",val);
+	      TRACE(clipboard,"\tselection is '%s'\n",val);
 
 	      for(i=0; i <= nitems; i++)
 		  if( val[i] == '\n' ) inlcount++;
@@ -985,7 +982,7 @@
      * selectionPrevWindow is nonzero if CheckSelection() was called. 
      */
 
-    dprintf_info(clipboard,"\tevent->window = %08x (sw = %08x, spw=%08x)\n", 
+    TRACE(clipboard,"\tevent->window = %08x (sw = %08x, spw=%08x)\n", 
 	  (unsigned)w, (unsigned)selectionWindow, (unsigned)selectionPrevWindow );
 
     if( selectionAcquired )
diff --git a/windows/dce.c b/windows/dce.c
index 21d1080..9ab105d 100644
--- a/windows/dce.c
+++ b/windows/dce.c
@@ -172,7 +172,7 @@
 
     dce->hClipRgn = 0;
 
-    dprintf_info(dc,"\trestoring VisRgn\n");
+    TRACE(dc,"\trestoring VisRgn\n");
 
     RestoreVisRgn(dce->hDC);
 }
@@ -226,10 +226,10 @@
     {
 	DCE *dce;
 
-	dprintf_info(dc,"InvalidateDCE: scope hwnd = %04x, (%i,%i - %i,%i)\n",
+	TRACE(dc,"scope hwnd = %04x, (%i,%i - %i,%i)\n",
 		     wndScope->hwndSelf, pRectUpdate->left,pRectUpdate->top,
 		     pRectUpdate->right,pRectUpdate->bottom);
-	if(debugging_info(dc)) 
+	if(TRACE_ON(dc)) 
 	  DCE_DumpCache();
 
  	/* walk all DCEs and fixup non-empty entries */
@@ -267,7 +267,7 @@
 				{
 				    /* Don't bother with visible regions of unused DCEs */
 
-				    dprintf_info(dc,"\tpurged %08x dce [%04x]\n", 
+				    TRACE(dc,"\tpurged %08x dce [%04x]\n", 
 						(unsigned)dce, wndCurrent->hwndSelf);
 
 				    dce->hwndCurrent = 0;
@@ -278,7 +278,7 @@
 				{
 				    /* Set dirty bits in the hDC and DCE structs */
 
-				    dprintf_info(dc,"\tfixed up %08x dce [%04x]\n", 
+				    TRACE(dc,"\tfixed up %08x dce [%04x]\n", 
 						(unsigned)dce, wndCurrent->hwndSelf);
 
 				    dce->DCXflags |= DCX_DCEDIRTY;
@@ -605,7 +605,7 @@
     BOOL32	bUpdateVisRgn = TRUE;
     BOOL32	bUpdateClipOrigin = FALSE;
 
-    dprintf_info(dc,"GetDCEx: hwnd %04x, hrgnClip %04x, flags %08x\n", 
+    TRACE(dc,"hwnd %04x, hrgnClip %04x, flags %08x\n", 
 				hwnd, hrgnClip, (unsigned)flags);
     
     if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
@@ -684,7 +684,7 @@
 		   ((dce->DCXflags & (DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN |
 				      DCX_CACHE | DCX_WINDOW | DCX_PARENTCLIP)) == dcxFlags))
 		{
-		    dprintf_info(dc,"\tfound valid %08x dce [%04x], flags %08x\n", 
+		    TRACE(dc,"\tfound valid %08x dce [%04x], flags %08x\n", 
 					(unsigned)dce, hwnd, (unsigned)dcxFlags );
 		    bUpdateVisRgn = FALSE; 
 		    bUpdateClipOrigin = TRUE;
@@ -699,7 +699,7 @@
         dce = (wndPtr->class->style & CS_OWNDC) ? wndPtr->dce : wndPtr->class->dce;
 	if( dce->hwndCurrent == hwnd )
 	{
-	    dprintf_info(dc,"\tskipping hVisRgn update\n");
+	    TRACE(dc,"\tskipping hVisRgn update\n");
 	    bUpdateVisRgn = FALSE; /* updated automatically, via DCHook() */
 
 	    if( (dce->DCXflags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) &&
@@ -733,7 +733,7 @@
     DCE_SetDrawable( wndPtr, dc, flags, bUpdateClipOrigin );
     if( bUpdateVisRgn )
     {
-	dprintf_info(dc,"updating visrgn for %08x dce, hwnd [%04x]\n", (unsigned)dce, hwnd);
+	TRACE(dc,"updating visrgn for %08x dce, hwnd [%04x]\n", (unsigned)dce, hwnd);
 
 	if (flags & DCX_PARENTCLIP)
         {
@@ -769,7 +769,7 @@
 	SelectVisRgn( hdc, hrgnVisible );
     }
     else
-	dprintf_info(dc,"no visrgn update %08x dce, hwnd [%04x]\n", (unsigned)dce, hwnd);
+	TRACE(dc,"no visrgn update %08x dce, hwnd [%04x]\n", (unsigned)dce, hwnd);
 
     /* apply additional region operation (if any) */
 
@@ -780,7 +780,7 @@
 	dce->DCXflags |= flags & (DCX_KEEPCLIPRGN | DCX_INTERSECTRGN | DCX_EXCLUDERGN);
 	dce->hClipRgn = hrgnClip;
 
-	dprintf_info(dc, "\tsaved VisRgn, clipRgn = %04x\n", hrgnClip);
+	TRACE(dc, "\tsaved VisRgn, clipRgn = %04x\n", hrgnClip);
 
 	SaveVisRgn( hdc );
         CombineRgn32( hrgnVisible, InquireVisRgn( hdc ), hrgnClip,
@@ -790,7 +790,7 @@
 
     if( hrgnVisible ) DeleteObject32( hrgnVisible );
 
-    dprintf_info(dc, "GetDCEx(%04x,%04x,0x%lx): returning %04x\n", 
+    TRACE(dc, "(%04x,%04x,0x%lx): returning %04x\n", 
 	       hwnd, hrgnClip, flags, hdc);
     return hdc;
 }
@@ -807,9 +807,13 @@
 
 /***********************************************************************
  *           GetDC32    (USER32.229)
+ * RETURNS
+ *	:Handle to DC
+ *	NULL: Failure
  */
-HDC32 WINAPI GetDC32( HWND32 hwnd )
-{
+HDC32 WINAPI GetDC32(
+	     HWND32 hwnd /* handle of window */
+) {
     if (!hwnd)
         return GetDCEx32( GetDesktopWindow32(), 0, DCX_CACHE | DCX_WINDOW );
     return GetDCEx32( hwnd, 0, DCX_USESTYLE );
@@ -841,18 +845,24 @@
  */
 INT16 WINAPI ReleaseDC16( HWND16 hwnd, HDC16 hdc )
 {
-    return (INT32)ReleaseDC32( hwnd, hdc );
+    return (INT16)ReleaseDC32( hwnd, hdc );
 }
 
 
 /***********************************************************************
  *           ReleaseDC32    (USER32.439)
+ *
+ * RETURNS
+ *	1: Success
+ *	0: Failure
  */
-INT32 WINAPI ReleaseDC32( HWND32 hwnd, HDC32 hdc )
-{
+INT32 WINAPI ReleaseDC32( 
+             HWND32 hwnd /* Handle of window - ignored */, 
+             HDC32 hdc   /* Handle of device context */
+) {
     DCE * dce = firstDCE;
     
-    dprintf_info(dc, "ReleaseDC: %04x %04x\n", hwnd, hdc );
+    TRACE(dc, "%04x %04x\n", hwnd, hdc );
         
     while (dce && (dce->hDC != hdc)) dce = dce->next;
 
@@ -872,7 +882,7 @@
     HRGN32 hVisRgn;
     DCE *dce = firstDCE;;
 
-    dprintf_info(dc,"DCHook: hDC = %04x, %i\n", hDC, code);
+    TRACE(dc,"hDC = %04x, %i\n", hDC, code);
 
     while (dce && (dce->hDC != hDC)) dce = dce->next;
     if (!dce) return 0;
@@ -891,7 +901,7 @@
 	       SetHookFlags(hDC, DCHF_VALIDATEVISRGN);
 	       hVisRgn = DCE_GetVisRgn(dce->hwndCurrent, dce->DCXflags);
 
-	       dprintf_info(dc,"\tapplying saved clipRgn\n");
+	       TRACE(dc,"\tapplying saved clipRgn\n");
   
 	       /* clip this region with saved clipping region */
 
@@ -911,7 +921,7 @@
 	       DeleteObject32( hVisRgn );
 	   }
            else /* non-fatal but shouldn't happen */
-	     dprintf_warn(dc, "DCHook: DC is not in use!\n");
+	     WARN(dc, "DC is not in use!\n");
 	   break;
 
       case DCHC_DELETEDC: /* FIXME: ?? */
diff --git a/windows/defwnd.c b/windows/defwnd.c
index cc3ec64..87a4daa 100644
--- a/windows/defwnd.c
+++ b/windows/defwnd.c
@@ -36,10 +36,10 @@
 {
     WPARAM16 wp = SIZE_RESTORED;
 
-    if (!(flags & SWP_NOCLIENTMOVE))
+    if (!(flags & SWP_NOMOVE))
         SendMessage16( wndPtr->hwndSelf, WM_MOVE, 0,
                     MAKELONG(wndPtr->rectClient.left, wndPtr->rectClient.top));
-    if (!(flags & SWP_NOCLIENTSIZE))
+    if (!(flags & SWP_NOSIZE))
     {
         if (wndPtr->dwStyle & WS_MAXIMIZE) wp = SIZE_MAXIMIZED;
         else if (wndPtr->dwStyle & WS_MINIMIZE) wp = SIZE_MINIMIZED;
@@ -97,7 +97,7 @@
 {
     BOOL32 bVisible = wndPtr->dwStyle & WS_VISIBLE;
 
-dprintf_info(win,"SetRedraw: %04x %i\n", wndPtr->hwndSelf, (wParam!=0) );
+TRACE(win,"%04x %i\n", wndPtr->hwndSelf, (wParam!=0) );
 
     if( wParam )
     {
@@ -184,7 +184,7 @@
 			SYSMETRICS_CXICON)/2;
 	        int y = (wndPtr->rectWindow.bottom - wndPtr->rectWindow.top -
 			SYSMETRICS_CYICON)/2;
-		dprintf_info(win,"Painting class icon: vis rect=(%i,%i - %i,%i)\n",
+		TRACE(win,"Painting class icon: vis rect=(%i,%i - %i,%i)\n",
 		ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom );
 	        DrawIcon32( hdc, x, y, wndPtr->class->hIcon );
 	      }
diff --git a/windows/dialog.c b/windows/dialog.c
index 2e2c85f..c6ad70c 100644
--- a/windows/dialog.c
+++ b/windows/dialog.c
@@ -83,7 +83,7 @@
     if (!(tm.tmPitchAndFamily & TMPF_FIXED_PITCH))
         xBaseUnit = xBaseUnit * 5 / 4;
 
-    dprintf_info(dialog, "DIALOG_Init: base units = %d,%d\n",
+    TRACE(dialog, "base units = %d,%d\n",
                     xBaseUnit, yBaseUnit );
     return TRUE;
 }
@@ -146,12 +146,12 @@
     p += *p + 1;
 
     if(int_id)
-      dprintf_info(dialog,"   %s %04x %d, %d, %d, %d, %d, %08lx, %08lx\n", 
+      TRACE(dialog,"   %s %04x %d, %d, %d, %d, %d, %08lx, %08lx\n", 
 		      info->className,  LOWORD(info->windowName),
 		      info->id, info->x, info->y, info->cx, info->cy,
 		      info->style, (DWORD)info->data);
     else
-      dprintf_info(dialog,"   %s '%s' %d, %d, %d, %d, %d, %08lx, %08lx\n", 
+      TRACE(dialog,"   %s '%s' %d, %d, %d, %d, %d, %08lx, %08lx\n", 
 		      info->className,  info->windowName,
 		      info->id, info->x, info->y, info->cx, info->cy,
 		      info->style, (DWORD)info->data);
@@ -221,12 +221,12 @@
     p++;
 
     if(int_id)
-      dprintf_info(dialog,"   %p %04x %d, %d, %d, %d, %d, %08lx, %08lx, %08lx\n", 
+      TRACE(dialog,"   %p %04x %d, %d, %d, %d, %d, %08lx, %08lx, %08lx\n", 
 		      info->className, LOWORD(info->windowName),
 		      info->id, info->x, info->y, info->cx, info->cy,
 		      info->style, info->exStyle, (DWORD)info->data);
     else
-      dprintf_info(dialog,"   %p '%p' %d, %d, %d, %d, %d, %08lx, %08lx, %08lx\n", 
+      TRACE(dialog,"   %p '%p' %d, %d, %d, %d, %d, %08lx, %08lx, %08lx\n", 
 		      info->className, info->windowName,
 		      info->id, info->x, info->y, info->cx, info->cy,
 		      info->style, info->exStyle, (DWORD)info->data);
@@ -248,7 +248,7 @@
     DLG_CONTROL_INFO info;
     HWND32 hwndCtrl, hwndDefButton = 0;
 
-    dprintf_info(dialog, " BEGIN\n" );
+    TRACE(dialog, " BEGIN\n" );
     while (items--)
     {
         if (!win32)
@@ -312,7 +312,7 @@
             dlgInfo->idResult = GetWindowWord32( hwndCtrl, GWW_ID );
         }
     }    
-    dprintf_info(dialog, " END\n" );
+    TRACE(dialog, " END\n" );
     return TRUE;
 }
 
@@ -332,9 +332,9 @@
     result->y       = GET_WORD(p);  p += sizeof(WORD);
     result->cx      = GET_WORD(p);  p += sizeof(WORD);
     result->cy      = GET_WORD(p);  p += sizeof(WORD);
-    dprintf_info(dialog, "DIALOG %d, %d, %d, %d\n",
+    TRACE(dialog, "DIALOG %d, %d, %d, %d\n",
                     result->x, result->y, result->cx, result->cy );
-    dprintf_info(dialog, " STYLE %08lx\n", result->style );
+    TRACE(dialog, " STYLE %08lx\n", result->style );
 
     /* Get the menu name */
 
@@ -347,11 +347,11 @@
     case 0xff:
         result->menuName = (LPCSTR)(UINT32)GET_WORD( p + 1 );
         p += 3;
-	dprintf_info(dialog, " MENU %04x\n", LOWORD(result->menuName) );
+	TRACE(dialog, " MENU %04x\n", LOWORD(result->menuName) );
         break;
     default:
         result->menuName = p;
-        dprintf_info(dialog, " MENU '%s'\n", p );
+        TRACE(dialog, " MENU '%s'\n", p );
         p += strlen(p) + 1;
         break;
     }
@@ -361,7 +361,7 @@
     if (*p)
     {
         result->className = p;
-        dprintf_info(dialog, " CLASS '%s'\n", result->className );
+        TRACE(dialog, " CLASS '%s'\n", result->className );
     }
     else result->className = DIALOG_CLASS_ATOM;
     p += strlen(p) + 1;
@@ -370,7 +370,7 @@
 
     result->caption = p;
     p += strlen(p) + 1;
-    dprintf_info(dialog, " CAPTION '%s'\n", result->caption );
+    TRACE(dialog, " CAPTION '%s'\n", result->caption );
 
     /* Get the font name */
 
@@ -380,7 +380,7 @@
         p += sizeof(WORD);
 	result->faceName = p;
         p += strlen(p) + 1;
-	dprintf_info(dialog, " FONT %d,'%s'\n",
+	TRACE(dialog, " FONT %d,'%s'\n",
                         result->pointSize, result->faceName );
     }
     return p;
@@ -404,10 +404,10 @@
     result->y       = GET_WORD(p); p++;
     result->cx      = GET_WORD(p); p++;
     result->cy      = GET_WORD(p); p++;
-    dprintf_info(dialog, "DIALOG %d, %d, %d, %d\n",
+    TRACE(dialog, "DIALOG %d, %d, %d, %d\n",
                     result->x, result->y, result->cx, result->cy );
-    dprintf_info(dialog, " STYLE %08lx\n", result->style );
-    dprintf_info(dialog, " EXSTYLE %08lx\n", result->exStyle );
+    TRACE(dialog, " STYLE %08lx\n", result->style );
+    TRACE(dialog, " EXSTYLE %08lx\n", result->exStyle );
 
     /* Get the menu name */
 
@@ -420,11 +420,11 @@
     case 0xffff:
         result->menuName = (LPCSTR)(UINT32)GET_WORD( p + 1 );
         p += 2;
-	dprintf_info(dialog, " MENU %04x\n", LOWORD(result->menuName) );
+	TRACE(dialog, " MENU %04x\n", LOWORD(result->menuName) );
         break;
     default:
         result->menuName = (LPCSTR)p;
-        dprintf_info(dialog, " MENU '%p'\n", p );
+        TRACE(dialog, " MENU '%p'\n", p );
         p += lstrlen32W( (LPCWSTR)p ) + 1;
         break;
     }
@@ -440,11 +440,11 @@
     case 0xffff:
         result->className = (LPCSTR)(UINT32)GET_WORD( p + 1 );
         p += 2;
-	dprintf_info(dialog, " CLASS %04x\n", LOWORD(result->className) );
+	TRACE(dialog, " CLASS %04x\n", LOWORD(result->className) );
         break;
     default:
         result->className = (LPCSTR)p;
-        dprintf_info(dialog, " CLASS '%p'\n", p );
+        TRACE(dialog, " CLASS '%p'\n", p );
         p += lstrlen32W( (LPCWSTR)p ) + 1;
         break;
     }
@@ -453,7 +453,7 @@
 
     result->caption = (LPCSTR)p;
     p += lstrlen32W( (LPCWSTR)p ) + 1;
-    dprintf_info(dialog, " CAPTION '%p'\n", result->caption );
+    TRACE(dialog, " CAPTION '%p'\n", result->caption );
 
     /* Get the font name */
 
@@ -463,7 +463,7 @@
         p++;
 	result->faceName = (LPCSTR)p;
         p += lstrlen32W( (LPCWSTR)p ) + 1;
-	dprintf_info(dialog, " FONT %d,'%p'\n",
+	TRACE(dialog, " FONT %d,'%p'\n",
                         result->pointSize, result->faceName );
     }
     /* First control is on dword boundary */
@@ -666,7 +666,7 @@
     HGLOBAL16 hmem;
     LPCVOID data;
 
-    dprintf_info(dialog, "CreateDialogParam16: %04x,%08lx,%04x,%08lx,%ld\n",
+    TRACE(dialog, "%04x,%08lx,%04x,%08lx,%ld\n",
                    hInst, (DWORD)dlgTemplate, owner, (DWORD)dlgProc, param );
 
     if (!(hRsrc = FindResource16( hInst, dlgTemplate, RT_DIALOG ))) return 0;
@@ -914,7 +914,7 @@
     WND * wndPtr = WIN_FindWndPtr( hwnd );
     DIALOGINFO * dlgInfo = (DIALOGINFO *)wndPtr->wExtra;
 
-    dprintf_info(dialog, "EndDialog: %04x %d\n", hwnd, retval );
+    TRACE(dialog, "%04x %d\n", hwnd, retval );
 
     if( dlgInfo )
     {
@@ -1556,7 +1556,7 @@
     BOOL32 ret;
     HWND32 listbox = GetDlgItem32( hwnd, id );
 
-    dprintf_info(dialog, "DlgDirSelect: %04x '%s' %d\n", hwnd, str, id );
+    TRACE(dialog, "%04x '%s' %d\n", hwnd, str, id );
     if (!listbox) return FALSE;
     if (win32)
     {
@@ -1605,7 +1605,7 @@
     if (unicode) lstrcpynAtoW( (LPWSTR)str, ptr, len );
     else lstrcpyn32A( str, ptr, len );
     SEGPTR_FREE( buffer );
-    dprintf_info(dialog, "Returning %d '%s'\n", ret, str );
+    TRACE(dialog, "Returning %d '%s'\n", ret, str );
     return ret;
 }
 
@@ -1626,7 +1626,7 @@
     ((attrib & DDL_POSTMSGS) ? PostMessage32A( hwnd, msg, wparam, lparam ) \
                              : SendMessage32A( hwnd, msg, wparam, lparam ))
 
-    dprintf_info(dialog, "DlgDirList: %04x '%s' %d %d %04x\n",
+    TRACE(dialog, "%04x '%s' %d %d %04x\n",
                     hDlg, spec ? spec : "NULL", idLBox, idStatic, attrib );
 
     if (spec && spec[0] && (spec[1] == ':'))
@@ -1658,7 +1658,7 @@
         }
     }
 
-    dprintf_info(dialog, "ListBoxDirectory: path=%c:\\%s mask=%s\n",
+    TRACE(dialog, "path=%c:\\%s mask=%s\n",
                     'A' + drive, DRIVE_GetDosCwd(drive), spec );
 
     if (idLBox && ((hwnd = GetDlgItem32( hDlg, idLBox )) != 0))
diff --git a/windows/driver.c b/windows/driver.c
index 85eefe3..317831f 100644
--- a/windows/driver.c
+++ b/windows/driver.c
@@ -31,12 +31,12 @@
     ptr = str;
     while (lstrlen32A( ptr ) != 0)
     {
-	dprintf_info(driver, "LoadStartupDrivers // str='%s'\n", ptr );
+	TRACE(driver, "str='%s'\n", ptr );
 	hDrv = OpenDriver( ptr, "drivers", 0L );
-	dprintf_info(driver, "LoadStartupDrivers // hDrv=%04x\n", hDrv );
+	TRACE(driver, "hDrv=%04x\n", hDrv );
 	ptr += lstrlen32A(ptr) + 1;
     }
-    dprintf_info(driver, "LoadStartupDrivers // end of list !\n" );
+    TRACE(driver, "end of list !\n" );
 
     return;
 }
@@ -50,7 +50,7 @@
     LPDRIVERITEM lpdrv;
     LRESULT retval;
 
-    dprintf_info(driver, "SendDriverMessage(%04x, %04X, %08lX, %08lX)\n",
+    TRACE(driver, "(%04x, %04X, %08lX, %08lX)\n",
 		    hDriver, msg, lParam1, lParam2 );
 
     lpdrv = (LPDRIVERITEM)GlobalLock16( hDriver );
@@ -63,7 +63,7 @@
     retval = Callbacks->CallDriverProc( lpdrv->lpDrvProc, 0L /* FIXME */,
                                         hDriver, msg, lParam1, lParam2 );
 
-    dprintf_info(driver, "SendDriverMessage // retval = %ld\n", retval );
+    TRACE(driver, "retval = %ld\n", retval );
 
     GlobalUnlock16( hDriver );
     return retval;
@@ -79,13 +79,13 @@
     char DrvName[128];
     WORD ordinal;
 
-    dprintf_info(driver,"OpenDriver('%s', '%s', %08lX);\n",
+    TRACE(driver,"('%s', '%s', %08lX);\n",
 		    lpDriverName, lpSectionName, lParam );
 
     if (lpSectionName == NULL) lpSectionName = "drivers";
     GetPrivateProfileString32A( lpSectionName, lpDriverName, "", DrvName,
 			     sizeof(DrvName), "SYSTEM.INI" );
-    dprintf_info(driver,"OpenDriver // DrvName='%s'\n", DrvName );
+    TRACE(driver,"DrvName='%s'\n", DrvName );
     if (lstrlen32A(DrvName) < 1) return 0;
 
     lpdrv = lpDrvItemList;
@@ -146,7 +146,7 @@
     SendDriverMessage( hDrvr, DRV_ENABLE, 0L, lParam );
     SendDriverMessage( hDrvr, DRV_OPEN, 0L, lParam );
 
-    dprintf_info(driver, "OpenDriver // hDrvr=%04x loaded !\n", hDrvr );
+    TRACE(driver, "hDrvr=%04x loaded !\n", hDrvr );
     return hDrvr;
 }
 
@@ -157,7 +157,7 @@
 {
     LPDRIVERITEM lpdrv;
 
-    dprintf_info(driver, "CloseDriver(%04x, %08lX, %08lX);\n",
+    TRACE(driver, "(%04x, %08lX, %08lX);\n",
 		    hDrvr, lParam1, lParam2 );
 
     lpdrv = (LPDRIVERITEM)GlobalLock16( hDrvr );
@@ -181,7 +181,7 @@
 	    GlobalFree16( hDrvr );
 	}
 
-        dprintf_info(driver, "CloseDriver // hDrvr=%04x closed !\n",
+        TRACE(driver, "hDrvr=%04x closed !\n",
 		        hDrvr );
 	return TRUE;
     }
@@ -196,7 +196,7 @@
     LPDRIVERITEM lpdrv;
     HMODULE16 hModule = 0;
 
-    dprintf_info(driver, "GetDriverModuleHandle(%04x);\n", hDrvr);
+    TRACE(driver, "(%04x);\n", hDrvr);
 
     lpdrv = (LPDRIVERITEM)GlobalLock16( hDrvr );
     if (lpdrv != NULL && lpdrv->dis.hDriver == hDrvr)
@@ -252,7 +252,7 @@
 {
     LPDRIVERITEM lpdrv;
 
-    dprintf_info(driver, "GetDriverInfo(%04x, %p);\n", hDrvr, lpDrvInfo );
+    TRACE(driver, "(%04x, %p);\n", hDrvr, lpDrvInfo );
 
     if (lpDrvInfo == NULL) return FALSE;
 
@@ -272,17 +272,17 @@
     LPDRIVERITEM lpdrv;
     HDRVR16 hRetDrv = 0;
 
-    dprintf_info(driver, "GetNextDriver(%04x, %08lX);\n", hDrvr, dwFlags );
+    TRACE(driver, "(%04x, %08lX);\n", hDrvr, dwFlags );
 
     if (hDrvr == 0)
     {
 	if (lpDrvItemList == NULL)
 	{
-	    dprintf_info(driver, "GetNextDriver // drivers list empty !\n");
+	    TRACE(driver, "drivers list empty !\n");
 	    LoadStartupDrivers();
 	    if (lpDrvItemList == NULL) return 0;
 	}
-	dprintf_info(driver,"GetNextDriver // return first %04x !\n",
+	TRACE(driver,"return first %04x !\n",
 		        lpDrvItemList->dis.hDriver );
 	return lpDrvItemList->dis.hDriver;
     }
@@ -303,6 +303,6 @@
 	GlobalUnlock16( hDrvr );
     }
 
-    dprintf_info(driver, "GetNextDriver // return %04x !\n", hRetDrv );
+    TRACE(driver, "return %04x !\n", hRetDrv );
     return hRetDrv;
 }
diff --git a/windows/event.c b/windows/event.c
index 0350f14..e55c048 100644
--- a/windows/event.c
+++ b/windows/event.c
@@ -154,7 +154,7 @@
                       (char **)&pWnd ) != 0)
         return;  /* Not for a registered window */
 
-    dprintf_info(event, "Got event %s for hwnd %04x\n",
+    TRACE(event, "Got event %s for hwnd %04x\n",
                    event_names[event->type], pWnd->hwndSelf );
 
     switch(event->type)
@@ -248,7 +248,7 @@
 	break;
 
     default:    
-	dprintf_warn(event, "Unprocessed event %s for hwnd %04x\n",
+	WARN(event, "Unprocessed event %s for hwnd %04x\n",
 	        event_names[event->type], pWnd->hwndSelf );
 	break;
     }
@@ -509,7 +509,7 @@
         TSXQueryTree( display, w, &root, &parent, &children, &total );
         if( children ) TSXFree( children );
     } while( parent && parent != ancestor );
-    dprintf_info(event, "\t%08x -> %08x\n", (unsigned)prev, (unsigned)w );
+    TRACE(event, "\t%08x -> %08x\n", (unsigned)prev, (unsigned)w );
     return ( parent ) ? w : 0 ;
 }
 
@@ -931,7 +931,7 @@
     }
 
     if(rprop == None) 
-       dprintf_info(event,"Request for %s ignored\n", TSXGetAtomName(display,event->target));
+       TRACE(event,"Request for %s ignored\n", TSXGetAtomName(display,event->target));
 
     result.type = SelectionNotify;
     result.display = display;
@@ -954,7 +954,7 @@
     if (event->target != XA_STRING) CLIPBOARD_ReadSelection( 0, None );
     else CLIPBOARD_ReadSelection( event->requestor, event->property );
 
-    dprintf_info(clipboard,"\tSelectionNotify done!\n");
+    TRACE(clipboard,"\tSelectionNotify done!\n");
 }
 
 
@@ -1086,7 +1086,7 @@
 	  } /* WS_EX_ACCEPTFILES */
        } /* dndProtocol */
        else
-	  dprintf_info(event, "unrecognized ClientMessage\n" );
+	  TRACE(event, "unrecognized ClientMessage\n" );
     }
 }
 
@@ -1144,7 +1144,7 @@
                            GrabModeAsync, GrabModeAsync,
                            None, None, CurrentTime ) == GrabSuccess) )
 	{
-            dprintf_info(win, "SetCapture(0x%04x)\n", hwnd );
+            TRACE(win, "(0x%04x)\n", hwnd );
             captureWnd   = hwnd;
 	    captureHT    = ht;
         }
@@ -1190,7 +1190,7 @@
  */
 void WINAPI ReleaseCapture(void)
 {
-    dprintf_info(win, "ReleaseCapture() [%04x]\n", captureWnd );
+    TRACE(win, "captureWnd=%04x\n", captureWnd );
     if( captureWnd ) EVENT_Capture( 0, 0 );
 }
 
@@ -1270,7 +1270,7 @@
 BOOL16 WINAPI EnableHardwareInput(BOOL16 bEnable)
 {
   BOOL16 bOldState = InputEnabled;
-  dprintf_fixme(event,"EnableHardwareInput(%d) - stub\n", bEnable);
+  FIXME(event,"(%d) - stub\n", bEnable);
   InputEnabled = bEnable;
   return bOldState;
 }
diff --git a/windows/hook.c b/windows/hook.c
index cff8d1a..ffd5ce5 100644
--- a/windows/hook.c
+++ b/windows/hook.c
@@ -847,7 +847,7 @@
 
     if ((id < WH_MINHOOK) || (id > WH_MAXHOOK)) return 0;
 
-    dprintf_info(hook, "Setting hook %d: %08x %04x %04x\n",
+    TRACE(hook, "Setting hook %d: %08x %04x %04x\n",
                   id, (UINT32)proc, hInst, hTask );
 
     if (!hInst && (type!=HOOK_WIN16))
@@ -885,7 +885,7 @@
         data->next = HOOK_systemHooks[id - WH_MINHOOK];
         HOOK_systemHooks[id - WH_MINHOOK] = handle;
     }
-    dprintf_info(hook, "Setting hook %d: ret=%04x [next=%04x]\n", 
+    TRACE(hook, "Setting hook %d: ret=%04x [next=%04x]\n", 
 			   id, handle, data->next );
     return handle;
 }
@@ -901,13 +901,13 @@
     HOOKDATA *data;
     HANDLE16 *prevHook;
 
-    dprintf_info(hook, "Removing hook %04x\n", hook );
+    TRACE(hook, "Removing hook %04x\n", hook );
 
     if (!(data = (HOOKDATA *)USER_HEAP_LIN_ADDR(hook))) return FALSE;
     if (data->flags & HOOK_INUSE)
     {
         /* Mark it for deletion later on */
-        dprintf_warn(hook, "Hook still running, deletion delayed\n" );
+        WARN(hook, "Hook still running, deletion delayed\n" );
         data->proc = (HOOKPROC32)0;
         return TRUE;
     }
@@ -981,12 +981,12 @@
     queue->hCurHook = hook;
     data->flags |= HOOK_INUSE;
 
-    dprintf_info(hook, "Calling hook %04x: %d %08x %08lx\n",
+    TRACE(hook, "Calling hook %04x: %d %08x %08lx\n",
                   hook, code, wParam, lParam );
 
     ret = data->proc(code, wParam, lParam);
 
-    dprintf_info(hook, "Ret hook %04x = %08lx\n", hook, ret );
+    TRACE(hook, "Ret hook %04x = %08lx\n", hook, ret );
 
     data->flags &= ~HOOK_INUSE;
     queue->hCurHook = prevHook;
@@ -1274,7 +1274,7 @@
 {
     HANDLE16 hook = HOOK_GetHook( id , GetTaskQueue(0) );
 
-    dprintf_info(hook, "UnhookWindowsHook: %d %08lx\n", id, (DWORD)proc );
+    TRACE(hook, "%d %08lx\n", id, (DWORD)proc );
 
     while (hook)
     {
@@ -1294,7 +1294,7 @@
 {
     HANDLE16 hook = HOOK_GetHook( id , GetTaskQueue(0) );
 
-    dprintf_info(hook, "UnhookWindowsHook: %d %08lx\n", id, (DWORD)proc );
+    TRACE(hook, "%d %08lx\n", id, (DWORD)proc );
 
     while (hook)
     {
diff --git a/windows/keyboard.c b/windows/keyboard.c
index 90189fc..5717db5 100644
--- a/windows/keyboard.c
+++ b/windows/keyboard.c
@@ -189,12 +189,12 @@
                     if (TSXKeycodeToKeysym(display, *kcp, k) == XK_Mode_switch)
 		    {
                         AltGrMask = 1 << i;
-                        dprintf_info(key, "AltGrMask is %x\n", AltGrMask);
+                        TRACE(key, "AltGrMask is %x\n", AltGrMask);
 		    }
                     else if (TSXKeycodeToKeysym(display, *kcp, k) == XK_Num_Lock)
 		    {
                         NumLockMask = 1 << i;
-                        dprintf_info(key, "NumLockMask is %x\n", NumLockMask);
+                        TRACE(key, "NumLockMask is %x\n", NumLockMask);
 		    }
             }
     }
@@ -281,11 +281,11 @@
 
                 vkey = OEMvkey;
 		  
-                if (debugging_info(keyboard))
+                if (TRACE_ON(keyboard))
                 {
 		    dbg_decl_str(keyboard, 1024);
 
-                    dprintf_info(keyboard, "OEM specific virtual key %X assigned"
+                    TRACE(keyboard, "OEM specific virtual key %X assigned"
 				 "to keycode %X :\n", OEMvkey, e2.keycode);
                     for (i = 0; i < keysyms_per_keycode; i += 1)
                     {
@@ -297,7 +297,7 @@
 			    ksname = "NoSymbol";
                         dsprintf(keyboard, "%lX (%s) ", keysym, ksname);
                     }
-                    dprintf_info(keyboard, "(%s)\n", dbg_str(keyboard));
+                    TRACE(keyboard, "(%s)\n", dbg_str(keyboard));
                 }
             }
         }
@@ -318,14 +318,14 @@
        don't treat it. It's from the same key press. Then the state goes to ON.
        And from there, a 'release' event will switch off the toggle key. */
     *State=FALSE;
-    dprintf_info(keyboard,"INTERM : don\'t treat release of toggle key. InputKeyStateTable[%#x] = %#x\n",vkey,InputKeyStateTable[vkey]);
+    TRACE(keyboard,"INTERM : don\'t treat release of toggle key. InputKeyStateTable[%#x] = %#x\n",vkey,InputKeyStateTable[vkey]);
   } else
     {
 	if ( InputKeyStateTable[vkey] & 0x1 ) /* it was ON */
 	  {
 	    if (Evtype!=KeyPress)
 	      {
-		dprintf_info(keyboard,"ON + KeyRelease => generating DOWN and UP messages.\n");
+		TRACE(keyboard,"ON + KeyRelease => generating DOWN and UP messages.\n");
 		localkeylp.lp1.previous = 0; /* ? */
 		localkeylp.lp1.transition = 0;
 		hardware_event( WM_KEYDOWN, vkey, localkeylp.lp2,
@@ -339,7 +339,7 @@
 	else /* it was OFF */
 	  if (Evtype==KeyPress)
 	    {
-	      dprintf_info(keyboard,"OFF + Keypress => generating DOWN and UP messages.\n");
+	      TRACE(keyboard,"OFF + Keypress => generating DOWN and UP messages.\n");
 	      hardware_event( WM_KEYDOWN, vkey, localkeylp.lp2,
                               event_x, event_y, event_time, 0 );
 	      localkeylp.lp1.previous = 1;
@@ -372,15 +372,15 @@
     INT32 event_y = pWnd->rectWindow.top + event->y;
     DWORD event_time = event->time - MSG_WineStartTicks;
 
-    dprintf_info(key, "EVENT_key : state = %X\n", event->state);
+    TRACE(key, "EVENT_key : state = %X\n", event->state);
     if (keysym == XK_Mode_switch)
 	{
-	dprintf_info(key, "Alt Gr key event received\n");
+	TRACE(key, "Alt Gr key event received\n");
 	event->keycode = TSXKeysymToKeycode(event->display, XK_Control_L);
-	dprintf_info(key, "Control_L is keycode 0x%x\n", event->keycode);
+	TRACE(key, "Control_L is keycode 0x%x\n", event->keycode);
 	KEYBOARD_HandleEvent( pWnd, event );
 	event->keycode = TSXKeysymToKeycode(event->display, XK_Alt_L);
-	dprintf_info(key, "Alt_L is keycode 0x%x\n", event->keycode);
+	TRACE(key, "Alt_L is keycode 0x%x\n", event->keycode);
 	force_extended = TRUE;
 	KEYBOARD_HandleEvent( pWnd, event );
 	force_extended = FALSE;
@@ -388,13 +388,13 @@
 	}
 
     Str[ascii_chars] = '\0';
-    if (debugging_info(key)){
+    if (TRACE_ON(key)){
 	char	*ksname;
 
 	ksname = TSXKeysymToString(keysym);
 	if (!ksname)
 	  ksname = "No Name";
-	dprintf_info(key, "%s : keysym=%lX (%s), ascii chars=%u / %X / '%s'\n", 
+	TRACE(key, "%s : keysym=%lX (%s), ascii chars=%u / %X / '%s'\n", 
 		     (event->type == KeyPress) ? "KeyPress" : "KeyRelease",
 		     keysym, ksname, ascii_chars, Str[0] & 0xff, Str);
     }
@@ -402,7 +402,7 @@
     vkey = EVENT_event_to_vkey(event);
     if (force_extended) vkey |= 0x100;
 
-    dprintf_info(key, "keycode 0x%x converted to vkey 0x%x\n",
+    TRACE(key, "keycode 0x%x converted to vkey 0x%x\n",
 		    event->keycode, vkey);
 
    if (vkey)
@@ -423,10 +423,10 @@
                             event_time, keylp);
       break;
     case VK_CAPITAL:
-      dprintf_info(keyboard,"Caps Lock event. (type %d). State before : %#.2x\n",event->type,InputKeyStateTable[vkey]);
+      TRACE(keyboard,"Caps Lock event. (type %d). State before : %#.2x\n",event->type,InputKeyStateTable[vkey]);
       KEYBOARD_GenerateMsg( VK_CAPITAL, event->type, event_x, event_y,
                             event_time, keylp ); 
-      dprintf_info(keyboard,"State after : %#.2x\n",InputKeyStateTable[vkey]);
+      TRACE(keyboard,"State after : %#.2x\n",InputKeyStateTable[vkey]);
       break;
     default:
       {
@@ -457,7 +457,7 @@
 			      (InputKeyStateTable[VK_MENU] & 0x80)) ? 1 : 0;
 	if (!(InputKeyStateTable[VK_NUMLOCK] & 0x01) != !(event->state & NumLockMask))
 	  { 
-	    dprintf_info(keyboard,"Adjusting NumLock state. \n");
+	    TRACE(keyboard,"Adjusting NumLock state. \n");
 	    KEYBOARD_GenerateMsg( VK_NUMLOCK, KeyPress, event_x, event_y,
                                   event_time, keylp );
 	    KEYBOARD_GenerateMsg( VK_NUMLOCK, KeyRelease, event_x, event_y,
@@ -465,20 +465,20 @@
 	  }
 	if (!(InputKeyStateTable[VK_CAPITAL] & 0x01) != !(event->state & LockMask))
 	  {
-	    dprintf_info(keyboard,"Adjusting Caps Lock state. State before %#.2x \n",InputKeyStateTable[VK_CAPITAL]);
+	    TRACE(keyboard,"Adjusting Caps Lock state. State before %#.2x \n",InputKeyStateTable[VK_CAPITAL]);
 	    KEYBOARD_GenerateMsg( VK_CAPITAL, KeyPress, event_x, event_y,
                                   event_time, keylp );
 	    KEYBOARD_GenerateMsg( VK_CAPITAL, KeyRelease, event_x, event_y,
                                   event_time, keylp );
-	    dprintf_info(keyboard,"State after %#.2x \n",InputKeyStateTable[VK_CAPITAL]);
+	    TRACE(keyboard,"State after %#.2x \n",InputKeyStateTable[VK_CAPITAL]);
 	  }
 	/* End of intermediary states. */
 	NumState = FALSE;
 	CapsState = FALSE;
 
-	dprintf_info(key,"            wParam=%04X, lParam=%08lX\n", 
+	TRACE(key,"            wParam=%04X, lParam=%08lX\n", 
 		    vkey, keylp.lp2 );
-	dprintf_info(key,"            InputKeyState=%X\n",
+	TRACE(key,"            InputKeyState=%X\n",
 		    InputKeyStateTable[vkey]);
 
 	hardware_event( message, vkey, keylp.lp2,
@@ -524,7 +524,7 @@
 	    retval = ( (WORD)(QueueKeyStateTable[vkey] & 0x80) << 8 ) |
 		       (WORD)(QueueKeyStateTable[vkey] & 0x01);
 	}
-    dprintf_info(key, "GetKeyState(0x%x) -> %x\n", vkey, retval);
+    TRACE(key, "(0x%x) -> %x\n", vkey, retval);
     return retval;
 }
 
@@ -536,7 +536,7 @@
  */
 VOID WINAPI GetKeyboardState(LPBYTE lpKeyState)
 {
-    dprintf_info(key, "GetKeyboardState()\n");
+    TRACE(key, "(%p)\n", lpKeyState);
     if (lpKeyState != NULL) {
 	QueueKeyStateTable[VK_LBUTTON] = MouseButtonsStates[0] ? 0x80 : 0;
 	QueueKeyStateTable[VK_MBUTTON] = MouseButtonsStates[1] ? 0x80 : 0;
@@ -550,7 +550,7 @@
  */
 VOID WINAPI SetKeyboardState(LPBYTE lpKeyState)
 {
-    dprintf_info(key, "SetKeyboardState()\n");
+    TRACE(key, "(%p)\n", lpKeyState);
     if (lpKeyState != NULL) {
 	memcpy(QueueKeyStateTable, lpKeyState, 256);
 	MouseButtonsStates[0] = (QueueKeyStateTable[VK_LBUTTON] != 0);
@@ -599,7 +599,7 @@
     memset( AsyncMouseButtonsStates, 0, sizeof(AsyncMouseButtonsStates) );
     memset( AsyncKeyStateTable, 0, sizeof(AsyncKeyStateTable) );
 
-    dprintf_info(key, "GetAsyncKeyState(%x) -> %x\n", nKey, retval);
+    TRACE(key, "(%x) -> %x\n", nKey, retval);
     return retval;
 }
 
@@ -634,14 +634,14 @@
     	if (msg->message == WM_CHAR) {
         if ( !(fVirt & FALT) && !(fVirt & FVIRTKEY) )
         {
-   	  dprintf_info(accel,"found accel for WM_CHAR: ('%c')\n",
+   	  TRACE(accel,"found accel for WM_CHAR: ('%c')\n",
 			msg->wParam&0xff);
    	  sendmsg=TRUE;
    	}  
       } else {
        if(fVirt & FVIRTKEY) {
 	INT32 mask = 0;
-        dprintf_info(accel,"found accel for virt_key %04x (scan %04x)\n",
+        TRACE(accel,"found accel for virt_key %04x (scan %04x)\n",
   	                       msg->wParam,0xff & HIWORD(msg->lParam));                
 	if(GetKeyState32(VK_SHIFT) & 0x8000) mask |= FSHIFT;
 	if(GetKeyState32(VK_CONTROL) & 0x8000) mask |= FCONTROL;
@@ -649,7 +649,7 @@
 	if(mask == (fVirt & (FSHIFT | FCONTROL | FALT)))
           sendmsg=TRUE;			    
         else
-          dprintf_info(accel,", but incorrect SHIFT/CTRL/ALT-state\n");
+          TRACE(accel,", but incorrect SHIFT/CTRL/ALT-state\n");
        }
        else
        {
@@ -657,7 +657,7 @@
          {
            if ((fVirt & FALT) && (msg->lParam & 0x20000000))
            {                                                   /* ^^ ALT pressed */
-	    dprintf_info(accel,"found accel for Alt-%c\n", msg->wParam&0xff);
+	    TRACE(accel,"found accel for Alt-%c\n", msg->wParam&0xff);
 	    sendmsg=TRUE;	    
 	   } 
          } 
@@ -714,7 +714,7 @@
           }
           if ( mesg==WM_COMMAND || mesg==WM_SYSCOMMAND )
           {
-              dprintf_info(accel,", sending %s, wParam=%0x\n",
+              TRACE(accel,", sending %s, wParam=%0x\n",
                   mesg==WM_COMMAND ? "WM_COMMAND" : "WM_SYSCOMMAND",
                   cmd);
 	      SendMessage32A(hWnd, mesg, cmd, 0x00010000L);
@@ -730,9 +730,9 @@
 	    *   #5: it's a menu option, but window is iconic
 	    *   #6: it's a menu option, but disabled
 	    */
-	    dprintf_info(accel,", but won't send WM_{SYS}COMMAND, reason is #%d\n",mesg);
+	    TRACE(accel,", but won't send WM_{SYS}COMMAND, reason is #%d\n",mesg);
 	    if(mesg==0)
-	      dprintf_err(accel, " unknown reason - please report!");
+	      ERR(accel, " unknown reason - please report!");
 	  }          
           return TRUE;         
       }
@@ -752,7 +752,7 @@
 	msg->message != WM_SYSKEYUP &&
     	msg->message != WM_CHAR) return 0;
 
-    dprintf_info(accel, "TranslateAccelerators hAccel=%04x, hWnd=%04x,\
+    TRACE(accel, "TranslateAccelerators hAccel=%04x, hWnd=%04x,\
 msg->hwnd=%04x, msg->message=%04x\n", hAccel,hWnd,msg->hwnd,msg->message);
 
     for (i = 0; lpAccelTbl[i].key ; i++)
@@ -775,7 +775,7 @@
 	msg->message != WM_SYSKEYUP &&
     	msg->message != WM_CHAR) return 0;
 
-    dprintf_info(accel, "TranslateAccelerators hAccel=%04x, hWnd=%04x,\
+    TRACE(accel, "TranslateAccelerators hAccel=%04x, hWnd=%04x,\
 msg->hwnd=%04x, msg->message=%04x\n", hAccel,hWnd,msg->hwnd,msg->message);
     STRUCT32_MSG16to32(msg,&msg32);
 
@@ -793,7 +793,7 @@
  */
 DWORD WINAPI OemKeyScan(WORD wOemChar)
 {
-    dprintf_info(keyboard,"*OemKeyScan (%d)\n",wOemChar);
+    TRACE(keyboard,"*OemKeyScan (%d)\n",wOemChar);
 
     return wOemChar;
 }
@@ -833,7 +833,7 @@
 	  keycode = TSXKeysymToKeycode(display, keysym | 0xFE00);
 	}
 
-	dprintf_info(keyboard,"VkKeyScan '%c'(%#lx, %lu): got keycode %#.2x\n",
+	TRACE(keyboard,"VkKeyScan '%c'(%#lx, %lu): got keycode %#.2x\n",
 			 cChar,keysym,keysym,keycode);
 	
 	if (keycode)
@@ -856,7 +856,7 @@
 	      index : ?     adds 0x0700 (ctrl+alt+shift (used?))
 	     */
 	  }
-	dprintf_info(keyboard," ... returning %#.2x\n", keyc2vkey[keycode]+highbyte);
+	TRACE(keyboard," ... returning %#.2x\n", keyc2vkey[keycode]+highbyte);
 	return keyc2vkey[keycode]+highbyte;   /* keycode -> (keyc2vkey) vkey */
 }
 
@@ -889,7 +889,7 @@
  */
 INT32 WINAPI GetKeyboardType32(INT32 nTypeFlag)
 {
-  dprintf_info(keyboard,"GetKeyboardType(%d)\n",nTypeFlag);
+  TRACE(keyboard,"(%d)\n",nTypeFlag);
   switch(nTypeFlag)
     {
     case 0:      /* Keyboard type */
@@ -930,9 +930,9 @@
  */
 UINT16 WINAPI MapVirtualKey16(UINT16 wCode, UINT16 wMapType)
 {
-#define returnMVK(value) { dprintf_info(keyboard,"returning 0x%x.\n",value); return value; }
+#define returnMVK(value) { TRACE(keyboard,"returning 0x%x.\n",value); return value; }
 
-	dprintf_info(keyboard,"MapVirtualKey wCode=0x%x wMapType=%d ... \n",
+	TRACE(keyboard,"MapVirtualKey wCode=0x%x wMapType=%d ... \n",
 			 wCode,wMapType);
 	switch(wMapType) {
 		case 0:	{ /* vkey-code to scan-code */
@@ -977,7 +977,7 @@
  */
 INT16 WINAPI GetKBCodePage16(void)
 {
-    dprintf_info(keyboard,"GetKBCodePage()\n");
+    TRACE(keyboard,"(void)\n");
     return 850;
 }
 
@@ -987,7 +987,7 @@
  */
 UINT32 WINAPI GetKBCodePage32(void)
 {
-    dprintf_info(keyboard,"GetKbCodePage()\n");
+    TRACE(keyboard,"(void)\n");
     return 850;
 }
 
@@ -1020,7 +1020,7 @@
 {
   /*	int i; */
 	
-    	dprintf_info(keyboard,"GetKeyNameText(%ld,<ptr>,%d)\n",lParam,nSize);
+    	TRACE(keyboard,"(%ld,<ptr>,%d)\n",lParam,nSize);
 
 	lParam >>= 16;
 	lParam &= 0xff;
@@ -1068,7 +1068,7 @@
 	  {
 	    if ((e.keycode) && ((virtKey<0x10) || (virtKey>0x12))) 
 		/* it's normal to have 2 shift, control, and alt ! */
-		dprintf_info(keyboard,"ToAscii : The keycodes %d and %d are matching the same vkey %#X\n",
+		TRACE(keyboard,"ToAscii : The keycodes %d and %d are matching the same vkey %#X\n",
 				 e.keycode,keyc,virtKey);
 	    e.keycode = keyc;
 	  }
@@ -1088,7 +1088,7 @@
     e.state = 0;
     if (lpKeyState[VK_SHIFT] & 0x80)
 	e.state |= ShiftMask;
-    dprintf_info(keyboard,"ToAscii : lpKeyState[0x14(VK_CAPITAL)]=%#x\n",lpKeyState[VK_CAPITAL]);
+    TRACE(keyboard,"ToAscii : lpKeyState[0x14(VK_CAPITAL)]=%#x\n",lpKeyState[VK_CAPITAL]);
     if (lpKeyState[VK_CAPITAL] & 0x01)
 	e.state |= LockMask;
     if (lpKeyState[VK_CONTROL] & 0x80)
@@ -1098,7 +1098,7 @@
 	    e.state |= ControlMask;
     if (lpKeyState[VK_NUMLOCK] & 0x01)
 	e.state |= NumLockMask;
-    dprintf_info(key, "ToAscii(%04X, %04X) : faked state = %X\n",
+    TRACE(key, "(%04X, %04X) : faked state = %X\n",
 		virtKey, scanCode, e.state);
     ret = TSXLookupString(&e, (LPVOID)lpChar, 2, &keysym, &cs);
     if (ret == 0)
@@ -1212,7 +1212,7 @@
 		}
 	    }
 	}
-    dprintf_info(key, "ToAscii about to return %d with char %x\n",
+    TRACE(key, "ToAscii about to return %d with char %x\n",
 		ret, *(char*)lpChar);
     return ret;
 }
diff --git a/windows/mdi.c b/windows/mdi.c
index 6bae674..739aa66 100644
--- a/windows/mdi.c
+++ b/windows/mdi.c
@@ -112,7 +112,7 @@
 	wndPtr = WIN_FindWndPtr(MDI_GetChildByID(clientWnd,index));
 	if( !wndPtr )
 	{
-	      dprintf_info(mdi,"MDIMenuDeleteItem: no window for id=%i\n",index);
+	      TRACE(mdi,"no window for id=%i\n",index);
 	      continue;
 	}
     
@@ -194,7 +194,7 @@
     HWND32 hwndFrame = GetParent32(hwnd);
     HMENU32 oldFrameMenu = GetMenu32(hwndFrame);
 
-    dprintf_info(mdi, "WM_MDISETMENU: %04x %04x %04x\n",
+    TRACE(mdi, "%04x %04x %04x\n",
                 hwnd, hmenuFrame, hmenuWindow);
 
     ci = (MDICLIENTINFO *) w->wExtra;
@@ -264,7 +264,7 @@
     WORD	     wIDmenu = ci->idFirstChild + ci->nActiveChildren;
     char	     lpstrDef[]="junk!";
 
-    dprintf_info(mdi, "MDICreateChild: origin %i,%i - dim %i,%i, style %08x\n", 
+    TRACE(mdi, "origin %i,%i - dim %i,%i, style %08x\n", 
                 cs->x, cs->y, cs->cx, cs->cy, (unsigned)cs->style);    
     /* calculate placement */
     MDI_CalcDefaultChildPos(w, ci->nTotalCreated++, pos, 0);
@@ -353,7 +353,7 @@
                 MDI_UpdateFrameText( w->parent, ci->self, MDI_REPAINTFRAME, NULL ); 
 	    }
 	}
-        dprintf_info(mdi, "MDICreateChild: created child - %04x\n",hwnd);
+        TRACE(mdi, "created child - %04x\n",hwnd);
     }
     else
     {
@@ -388,7 +388,7 @@
     lpMinMax->ptMaxPosition.x = rect.left;
     lpMinMax->ptMaxPosition.y = rect.top; 
 
-    dprintf_info(mdi,"\tChildMinMaxInfo: max rect (%i,%i - %i, %i)\n", 
+    TRACE(mdi,"max rect (%i,%i - %i, %i)\n", 
                         rect.left,rect.top,rect.right,rect.bottom);
 }
 
@@ -410,7 +410,7 @@
  
     ci = (MDICLIENTINFO *) w->wExtra;
 
-    dprintf_info(mdi, "MDI_SwitchActiveChild: from %04x, to %04x\n",childHwnd,hwndTo);
+    TRACE(mdi, "from %04x, to %04x\n",childHwnd,hwndTo);
 
     if ( !hwndTo ) return; /* no window to switch to */
 
@@ -470,7 +470,7 @@
 	
         ci->nActiveChildren--;
 
-        dprintf_info(mdi,"MDIDestroyChild: child destroyed - %04x\n",child);
+        TRACE(mdi,"child destroyed - %04x\n",child);
 
         if (flagDestroy)
 	{
@@ -501,7 +501,7 @@
     if( wndPtr )
         if( wndPtr->dwStyle & WS_DISABLED ) return 0L;
 
-    dprintf_info(mdi,"MDI_ChildActivate: %04x\n", hWndChild);
+    TRACE(mdi,"%04x\n", hWndChild);
 
     if( GetActiveWindow32() == clientPtr->parent->hwndSelf )
         isActiveFrameWnd = TRUE;
@@ -625,7 +625,7 @@
 	    /* walk the list and move windows */
 	    while ( *ppWnd )
 	    {
-		dprintf_info(mdi, "MDICascade: move %04x to (%d,%d) size [%d,%d]\n", 
+		TRACE(mdi, "move %04x to (%d,%d) size [%d,%d]\n", 
                             (*ppWnd)->hwndSelf, pos[0].x, pos[0].y, pos[1].x, pos[1].y);
 
 		MDI_CalcDefaultChildPos(clientWnd, n++, pos, delta);
@@ -659,7 +659,7 @@
     ppWnd = WIN_BuildWinArray(wndClient, BWA_SKIPHIDDEN | BWA_SKIPOWNED | BWA_SKIPICONIC |
 	    ((wParam & MDITILE_SKIPDISABLED)? BWA_SKIPDISABLED : 0), &total );
 
-    dprintf_info(mdi,"MDITile: %u windows to tile\n", total);
+    TRACE(mdi,"%u windows to tile\n", total);
 
     if( ppWnd )
     {
@@ -728,7 +728,7 @@
     WND*	child = WIN_FindWndPtr(hChild);
     HMENU32  	hSysPopup = 0;
 
-    dprintf_info(mdi,"MDI_AugmentFrameMenu: frame %p,child %04x\n",frame,hChild);
+    TRACE(mdi,"frame %p,child %04x\n",frame,hChild);
 
     if( !frame->wIDmenu || !child->hSysMenu ) return 0; 
 
@@ -737,7 +737,7 @@
     if (!(hSysPopup = LoadMenuIndirect32A(SYSRES_GetResPtr(SYSRES_MENU_SYSMENU))))
 	return 0;
  
-    dprintf_info(mdi,"\tgot popup %04x in sysmenu %04x\n", 
+    TRACE(mdi,"\tgot popup %04x in sysmenu %04x\n", 
 		hSysPopup, child->hSysMenu);
  
     if( !InsertMenu32A(frame->wIDmenu,0,MF_BYPOSITION | MF_BITMAP | MF_POPUP,
@@ -771,7 +771,7 @@
 {
     INT32 nItems = GetMenuItemCount32(frameWnd->wIDmenu) - 1;
 
-    dprintf_info(mdi,"MDI_RestoreFrameMenu: for child %04x\n",hChild);
+    TRACE(mdi,"for child %04x\n",hChild);
 
     if( GetMenuItemID32(frameWnd->wIDmenu,nItems) != SC_RESTORE )
 	return 0; 
@@ -798,7 +798,7 @@
     WND*   clientWnd = WIN_FindWndPtr(hClient);
     MDICLIENTINFO *ci = (MDICLIENTINFO *) clientWnd->wExtra;
 
-    dprintf_info(mdi, "MDI: repaint %i, frameText %s\n", repaint, (lpTitle)?lpTitle:"NULL");
+    TRACE(mdi, "repaint %i, frameText %s\n", repaint, (lpTitle)?lpTitle:"NULL");
 
     if (!clientWnd)
            return;
@@ -925,7 +925,7 @@
 	NC_HandleNCCalcSize( w, &rect );
 	w->rectClient = rect;
 
-	dprintf_info(mdi,"MDI: Client created - hwnd = %04x, idFirst = %u\n",
+	TRACE(mdi,"Client created - hwnd = %04x, idFirst = %u\n",
 			   hwnd, ci->idFirstChild );
 
 	return 0;
@@ -1017,7 +1017,7 @@
             POINT16  pt = MAKEPOINT16(lParam);
             HWND16 child = ChildWindowFromPoint16(hwnd, pt);
 
-	    dprintf_info(mdi,"MDIClient: notification from %04x (%i,%i)\n",child,pt.x,pt.y);
+	    TRACE(mdi,"notification from %04x (%i,%i)\n",child,pt.x,pt.y);
 
             if( child && child != hwnd && child != ci->hwndActiveChild )
                 SetWindowPos32(child, 0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE );
@@ -1265,7 +1265,7 @@
 	return 0;
 
       case WM_NCPAINT:
-	dprintf_info(mdi,"DefMDIChildProc: WM_NCPAINT for %04x, active %04x\n",
+	TRACE(mdi,"WM_NCPAINT for %04x, active %04x\n",
 					     hwnd, ci->hwndActiveChild );
 	break;
 
@@ -1332,7 +1332,7 @@
 	        SendMessage16( hMaxChild, WM_SETREDRAW, TRUE, 0L );
 	    }
 
-	    dprintf_info(mdi,"\tMDI: maximizing child %04x\n", hwnd );
+	    TRACE(mdi,"maximizing child %04x\n", hwnd );
 
 	    ci->hwndChildMaximized = hwnd; /* !!! */
 
@@ -1523,7 +1523,7 @@
 		    default:
 			 return 0;
 		}
-	        dprintf_info(mdi,"TranslateMDISysAccel: wParam = %04x\n", wParam);
+	        TRACE(mdi,"wParam = %04x\n", wParam);
 	        SendMessage16( ci->hwndActiveChild, WM_SYSCOMMAND, 
 					wParam, (LPARAM)msg->wParam);
 	        return 1;
diff --git a/windows/message.c b/windows/message.c
index 6b627a0..294e254 100644
--- a/windows/message.c
+++ b/windows/message.c
@@ -355,7 +355,7 @@
   tmpMsg = SEGPTR_NEW(EVENTMSG16);
   wtime=HOOK_CallHooks16( WH_JOURNALPLAYBACK, HC_GETNEXT, 0,
 			  (LPARAM)SEGPTR_GET(tmpMsg));
-  /*  dprintf_info(msg,"Playback wait time =%ld\n",wtime); */
+  /*  TRACE(msg,"Playback wait time =%ld\n",wtime); */
   if (wtime<=0)
   {
    wtime=0;
@@ -596,12 +596,12 @@
     if (IsTaskLocked() || !IsWindow32(hwnd)) return 0;
 
     debugSMRL+=4;
-    dprintf_info(sendmsg,"%*sSM: %s [%04x] (%04x -> %04x)\n", 
+    TRACE(sendmsg,"%*sSM: %s [%04x] (%04x -> %04x)\n", 
 		    prevSMRL, "", SPY_GetMsgName(msg), msg, queue->self, hDestQueue );
 
     if( !(queue->wakeBits & QS_SMPARAMSFREE) )
     {
-      dprintf_info(sendmsg,"\tIntertask SendMessage: sleeping since unreplied SendMessage pending\n");
+      TRACE(sendmsg,"\tIntertask SendMessage: sleeping since unreplied SendMessage pending\n");
       queue->changeBits &= ~QS_SMPARAMSFREE;
       QUEUE_WaitBits( QS_SMPARAMSFREE );
     }
@@ -619,7 +619,7 @@
     queue->wakeBits &= ~QS_SMPARAMSFREE;
     queue->flags = (queue->flags & ~(QUEUE_SM_WIN32|QUEUE_SM_UNICODE)) | flags;
 
-    dprintf_info(sendmsg,"%*ssm: smResultInit = %08x\n", prevSMRL, "", (unsigned)&qCtrl);
+    TRACE(sendmsg,"%*ssm: smResultInit = %08x\n", prevSMRL, "", (unsigned)&qCtrl);
 
     queue->smResultInit = &qCtrl;
 
@@ -634,11 +634,11 @@
         queue->changeBits &= ~QS_SMRESULT;
         DirectedYield( destQ->hTask );
         QUEUE_WaitBits( QS_SMRESULT );
-	dprintf_info(sendmsg,"\tsm: have result!\n");
+	TRACE(sendmsg,"\tsm: have result!\n");
       }
       /* got something */
 
-      dprintf_info(sendmsg,"%*ssm: smResult = %08x\n", prevSMRL, "", (unsigned)queue->smResult );
+      TRACE(sendmsg,"%*ssm: smResult = %08x\n", prevSMRL, "", (unsigned)queue->smResult );
 
       if (queue->smResult) { /* FIXME, smResult should always be set */
         queue->smResult->lResult = queue->SendMessageReturn;
@@ -647,11 +647,11 @@
       queue->wakeBits &= ~QS_SMRESULT;
 
       if( queue->smResult != &qCtrl )
-	  dprintf_err(sendmsg, "%*ssm: weird scenes inside the goldmine!\n", prevSMRL, "");
+	  ERR(sendmsg, "%*ssm: weird scenes inside the goldmine!\n", prevSMRL, "");
     }
     queue->smResultInit = NULL;
     
-    dprintf_info(sendmsg,"%*sSM: [%04x] returning %08lx\n", prevSMRL, "", msg, qCtrl.lResult);
+    TRACE(sendmsg,"%*sSM: [%04x] returning %08lx\n", prevSMRL, "", msg, qCtrl.lResult);
     debugSMRL-=4;
 
     return qCtrl.lResult;
@@ -668,11 +668,11 @@
 
     if (!(queue = (MESSAGEQUEUE*)GlobalLock16( GetTaskQueue(0) ))) return;
 
-    dprintf_info(msg,"ReplyMessage, queue %04x\n", queue->self);
+    TRACE(msg,"ReplyMessage, queue %04x\n", queue->self);
 
     while( (senderQ = (MESSAGEQUEUE*)GlobalLock16( queue->InSendMessageHandle)))
     {
-      dprintf_info(msg,"\trpm: replying to %04x (%04x -> %04x)\n",
+      TRACE(msg,"\trpm: replying to %04x (%04x -> %04x)\n",
                           queue->msg, queue->self, senderQ->self);
 
       if( queue->wakeBits & QS_SENDMESSAGE )
@@ -684,10 +684,10 @@
       if(!(senderQ->wakeBits & QS_SMRESULT) ) break;
       OldYield();
     } 
-    if( !senderQ ) { dprintf_info(msg,"\trpm: done\n"); return; }
+    if( !senderQ ) { TRACE(msg,"\trpm: done\n"); return; }
 
     senderQ->SendMessageReturn = result;
-    dprintf_info(msg,"\trpm: smResult = %08x, result = %08lx\n", 
+    TRACE(msg,"\trpm: smResult = %08x, result = %08lx\n", 
 			(unsigned)queue->smResultCurrent, result );
 
     senderQ->smResult = queue->smResultCurrent;
@@ -937,7 +937,7 @@
     MSG_PeekMessage( lpmsg,
                      hwnd, first, last, PM_REMOVE, FALSE );
 
-    dprintf_info(msg,"message %04x, hwnd %04x, filter(%04x - %04x)\n", lpmsg->message,
+    TRACE(msg,"message %04x, hwnd %04x, filter(%04x - %04x)\n", lpmsg->message,
 		     				                 hwnd, first, last );
     HOOK_CallHooks16( WH_GETMESSAGE, HC_ACTION, 0, (LPARAM)msg );
     return (lpmsg->message != WM_QUIT);
@@ -968,17 +968,17 @@
     
     if (hwnd == HWND_BROADCAST)
     {
-        dprintf_info(msg,"PostMessage // HWND_BROADCAST !\n");
+        TRACE(msg,"HWND_BROADCAST !\n");
         for (wndPtr = WIN_GetDesktop()->child; wndPtr; wndPtr = wndPtr->next)
         {
             if (wndPtr->dwStyle & WS_POPUP || wndPtr->dwStyle & WS_CAPTION)
             {
-                dprintf_info(msg,"BROADCAST Message to hWnd=%04x m=%04X w=%04X l=%08lX !\n",
+                TRACE(msg,"BROADCAST Message to hWnd=%04x m=%04X w=%04X l=%08lX !\n",
                             wndPtr->hwndSelf, message, wParam, lParam);
                 PostMessage16( wndPtr->hwndSelf, message, wParam, lParam );
             }
         }
-        dprintf_info(msg,"PostMessage // End of HWND_BROADCAST !\n");
+        TRACE(msg,"End of HWND_BROADCAST !\n");
         return TRUE;
     }
 
@@ -1051,20 +1051,20 @@
     {
         if (!(list = WIN_BuildWinArray( WIN_GetDesktop(), 0, NULL )))
             return TRUE;
-        dprintf_info(msg,"SendMessage // HWND_BROADCAST !\n");
+        TRACE(msg,"HWND_BROADCAST !\n");
         for (ppWnd = list; *ppWnd; ppWnd++)
         {
             wndPtr = *ppWnd;
             if (!IsWindow32(wndPtr->hwndSelf)) continue;
             if (wndPtr->dwStyle & WS_POPUP || wndPtr->dwStyle & WS_CAPTION)
             {
-                dprintf_info(msg,"BROADCAST Message to hWnd=%04x m=%04X w=%04lX l=%08lX !\n",
+                TRACE(msg,"BROADCAST Message to hWnd=%04x m=%04X w=%04lX l=%08lX !\n",
                             wndPtr->hwndSelf, msg, (DWORD)wParam, lParam);
                 SendMessage16( wndPtr->hwndSelf, msg, wParam, lParam );
             }
         }
         HeapFree( SystemHeap, 0, list );
-        dprintf_info(msg,"SendMessage // End of HWND_BROADCAST !\n");
+        TRACE(msg,"End of HWND_BROADCAST !\n");
         return TRUE;
     }
 
@@ -1423,15 +1423,15 @@
     BYTE wp[2];
     
     if (message != WM_MOUSEMOVE && message != WM_TIMER)
-        dprintf_info(msg, "TranslateMessage(%s, %04X, %08lX)\n",
+        TRACE(msg, "(%s, %04X, %08lX)\n",
 		     SPY_GetMsgName(message), wParam, lParam );
     if(message >= WM_KEYFIRST && message <= WM_KEYLAST)
-        dprintf_info(key, "TranslateMessage(%s, %04X, %08lX)\n",
+        TRACE(key, "(%s, %04X, %08lX)\n",
 		     SPY_GetMsgName(message), wParam, lParam );
 
     if ((message != WM_KEYDOWN) && (message != WM_SYSKEYDOWN)) return FALSE;
 
-    dprintf_info(key, "Translating key %04X, scancode %04X\n",
+    TRACE(key, "Translating key %04X, scancode %04X\n",
                  wParam, HIWORD(lParam) );
 
     /* FIXME : should handle ToAscii yielding 2 */
@@ -1462,14 +1462,14 @@
                 }
             dead_char = 0;
         }
-        dprintf_info(key, "1 -> PostMessage(%s)\n", SPY_GetMsgName(message));
+        TRACE(key, "1 -> PostMessage(%s)\n", SPY_GetMsgName(message));
         PostMessage16( hwnd, message, wp[0], lParam );
         return TRUE;
 
     case -1 :
         message = (message == WM_KEYDOWN) ? WM_DEADCHAR : WM_SYSDEADCHAR;
         dead_char = wp[0];
-        dprintf_info(key, "-1 -> PostMessage(%s)\n",
+        TRACE(key, "-1 -> PostMessage(%s)\n",
                      SPY_GetMsgName(message));
         PostMessage16( hwnd, message, wp[0], lParam );
         return TRUE;
@@ -1642,7 +1642,7 @@
  */
 WORD WINAPI RegisterWindowMessage16( SEGPTR str )
 {
-    dprintf_info(msg, "RegisterWindowMessage16: %08lx\n", (DWORD)str );
+    TRACE(msg, "%08lx\n", (DWORD)str );
     return GlobalAddAtom16( str );
 }
 
@@ -1652,7 +1652,7 @@
  */
 WORD WINAPI RegisterWindowMessage32A( LPCSTR str )
 {
-    dprintf_info(msg, "RegisterWindowMessage32A: %s\n", str );
+    TRACE(msg, "%s\n", str );
     return GlobalAddAtom32A( str );
 }
 
@@ -1662,7 +1662,7 @@
  */
 WORD WINAPI RegisterWindowMessage32W( LPCWSTR str )
 {
-    dprintf_info(msg, "RegisterWindowMessage32W: %p\n", str );
+    TRACE(msg, "%p\n", str );
     return GlobalAddAtom32W( str );
 }
 
diff --git a/windows/nonclient.c b/windows/nonclient.c
index 03ebe51..6d75fc1 100644
--- a/windows/nonclient.c
+++ b/windows/nonclient.c
@@ -201,7 +201,7 @@
     exStyle &= WS_EX_DLGMODALFRAME;
     if (exStyle & WS_EX_DLGMODALFRAME) style &= ~WS_THICKFRAME;
 
-    dprintf_info(nonclient, "AdjustWindowRectEx: (%d,%d)-(%d,%d) %08lx %d %08lx\n",
+    TRACE(nonclient, "(%d,%d)-(%d,%d) %08lx %d %08lx\n",
                       rect->left, rect->top, rect->right, rect->bottom,
                       style, menu, exStyle );
 
@@ -255,7 +255,7 @@
 	winRect->bottom -= tmpRect.bottom;
 
 	if (HAS_MENU(pWnd)) {
-	    dprintf_info(nonclient, "NC_HandleNCCalcSize: Calling "
+	    TRACE(nonclient, "Calling "
 			       "GetMenuBarHeight with HWND 0x%x, width %d, "
 			       "at (%d, %d).\n", pWnd->hwndSelf,
 			       winRect->right - winRect->left,
@@ -322,7 +322,7 @@
     WND *wndPtr = WIN_FindWndPtr( hwnd );
     if (!wndPtr) return HTERROR;
 
-    dprintf_info(nonclient, "NC_HandleNCHitTest: hwnd=%04x pt=%d,%d\n",
+    TRACE(nonclient, "hwnd=%04x pt=%d,%d\n",
 		      hwnd, pt.x, pt.y );
 
     GetWindowRect16( hwnd, &rect );
@@ -1012,7 +1012,7 @@
 
     active  = wndPtr->flags & WIN_NCACTIVATED;
 
-    dprintf_info(nonclient, "NC_DoNCPaint: %04x %d\n", hwnd, active );
+    TRACE(nonclient, "%04x %d\n", hwnd, active );
 
     if (!(hdc = GetDCEx32( hwnd, 0, DCX_USESTYLE | DCX_WINDOW ))) return;
 
@@ -1119,7 +1119,7 @@
 
     active  = wndPtr->flags & WIN_NCACTIVATED;
 
-    dprintf_info(nonclient, "NC_DoNCPaint95: %04x %d\n", hwnd, active );
+    TRACE(nonclient, "%04x %d\n", hwnd, active );
 
     if (!(hdc = GetDCEx32( hwnd, 0, DCX_USESTYLE | DCX_WINDOW ))) return;
 
@@ -1172,14 +1172,14 @@
 	r.bottom = rect.top + sysMetrics[SM_CYMENU] - sysMetrics[SM_CYBORDER];
 	r.top -= sysMetrics[SM_CYBORDER];
 	
-	dprintf_info(nonclient, "DoNCPaint95: Calling DrawMenuBar with "
+	TRACE(nonclient, "Calling DrawMenuBar with "
 			  "rect (%d, %d)-(%d, %d)\n", r.left, r.top,
 			  r.right, r.bottom);
 
 	rect.top += MENU_DrawMenuBar( hdc, &r, hwnd, suppress_menupaint );
     }
 
-    dprintf_info(nonclient, "After MenuBar, rect is (%d, %d)-(%d, %d).\n",
+    TRACE(nonclient, "After MenuBar, rect is (%d, %d)-(%d, %d).\n",
 		       rect.left, rect.top, rect.right, rect.bottom );
 
     /* Draw the inner frames */
@@ -1881,7 +1881,7 @@
     POINT32 pt32;
     UINT16 uCommand = wParam & 0xFFF0;
 
-    dprintf_info(nonclient, "Handling WM_SYSCOMMAND %x %d,%d\n", 
+    TRACE(nonclient, "Handling WM_SYSCOMMAND %x %d,%d\n", 
 		      wParam, pt.x, pt.y );
 
     if (wndPtr->dwStyle & WS_CHILD && uCommand != SC_KEYMENU )
diff --git a/windows/painting.c b/windows/painting.c
index 20c8b12..a78982f3 100644
--- a/windows/painting.c
+++ b/windows/painting.c
@@ -28,7 +28,7 @@
     POINT16 pt = {0, 0}; 
     HRGN32 hClip = 1;
 
-    dprintf_info(nonclient,"NCUpdate: hwnd %04x, hrgnUpdate %04x\n", 
+    TRACE(nonclient,"hwnd %04x, hrgnUpdate %04x\n", 
                       wnd->hwndSelf, wnd->hrgnUpdate );
 
     /* desktop window doesn't have nonclient area */
@@ -110,7 +110,7 @@
 
     HideCaret32( hwnd );
 
-    dprintf_info(win,"hrgnUpdate = %04x, \n", hrgnUpdate);
+    TRACE(win,"hrgnUpdate = %04x, \n", hrgnUpdate);
 
     /* When bIcon is TRUE hrgnUpdate is automatically in window coordinates
      * (because rectClient == rectWindow for WS_MINIMIZE windows).
@@ -131,7 +131,7 @@
                              (bIcon ? DCX_WINDOW : 0) );
     }
 
-    dprintf_info(win,"hdc = %04x\n", lps->hdc);
+    TRACE(win,"hdc = %04x\n", lps->hdc);
 
     if (!lps->hdc)
     {
@@ -141,7 +141,7 @@
 
     GetRgnBox16( InquireVisRgn(lps->hdc), &lps->rcPaint );
 
-dprintf_info(win,"box = (%i,%i - %i,%i)\n", lps->rcPaint.left, lps->rcPaint.top,
+TRACE(win,"box = (%i,%i - %i,%i)\n", lps->rcPaint.left, lps->rcPaint.top,
 		    lps->rcPaint.right, lps->rcPaint.bottom );
 
     DPtoLP16( lps->hdc, (LPPOINT16)&lps->rcPaint, 2 );
@@ -295,13 +295,13 @@
     bIcon = (wndPtr->dwStyle & WS_MINIMIZE && wndPtr->class->hIcon);
     if (rectUpdate)
     {
-        dprintf_info(win, "RedrawWindow: %04x %d,%d-%d,%d %04x flags=%04x\n",
+        TRACE(win, "%04x %d,%d-%d,%d %04x flags=%04x\n",
                     hwnd, rectUpdate->left, rectUpdate->top,
                     rectUpdate->right, rectUpdate->bottom, hrgnUpdate, flags );
     }
     else
     {
-        dprintf_info(win, "RedrawWindow: %04x NULL %04x flags=%04x\n",
+        TRACE(win, "%04x NULL %04x flags=%04x\n",
                      hwnd, hrgnUpdate, flags);
     }
 
diff --git a/windows/property.c b/windows/property.c
index 221048c..9c3ac18 100644
--- a/windows/property.c
+++ b/windows/property.c
@@ -73,10 +73,10 @@
     PROPERTY *prop = PROP_FindProp( hwnd, str );
 
     if (HIWORD(str))
-        dprintf_info(prop, "GetProp(%08x,'%s'): returning %08x\n",
+        TRACE(prop, "(%08x,'%s'): returning %08x\n",
                       hwnd, str, prop ? prop->handle : 0 );
     else
-        dprintf_info(prop, "GetProp(%08x,#%04x): returning %08x\n",
+        TRACE(prop, "(%08x,#%04x): returning %08x\n",
                       hwnd, LOWORD(str), prop ? prop->handle : 0 );
 
     return prop ? prop->handle : 0;
@@ -116,9 +116,9 @@
     PROPERTY *prop;
 
     if (HIWORD(str))
-        dprintf_info(prop, "SetProp: %04x '%s' %08x\n", hwnd, str, handle );
+        TRACE(prop, "%04x '%s' %08x\n", hwnd, str, handle );
     else
-        dprintf_info(prop, "SetProp: %04x #%04x %08x\n",
+        TRACE(prop, "%04x #%04x %08x\n",
                       hwnd, LOWORD(str), handle );
 
     if (!(prop = PROP_FindProp( hwnd, str )))
@@ -177,9 +177,9 @@
     WND *pWnd = WIN_FindWndPtr( hwnd );
 
     if (HIWORD(str))
-      dprintf_info(prop, "RemoveProp: %04x '%s'\n", hwnd, str );
+      TRACE(prop, "%04x '%s'\n", hwnd, str );
     else
-      dprintf_info(prop, "RemoveProp: %04x #%04x\n", hwnd, LOWORD(str));
+      TRACE(prop, "%04x #%04x\n", hwnd, LOWORD(str));
 
 
     if (!pWnd) return NULL;
@@ -262,7 +262,7 @@
     WND *pWnd;
     INT16 ret = -1;
 
-    dprintf_info(prop, "EnumProps: %04x %08x\n", hwnd, (UINT32)func );
+    TRACE(prop, "%04x %08x\n", hwnd, (UINT32)func );
     if (!(pWnd = WIN_FindWndPtr( hwnd ))) return -1;
     for (prop = pWnd->pProp; (prop); prop = next)
     {
@@ -270,7 +270,7 @@
         /* function removes the current property.    */
         next = prop->next;
 
-        dprintf_info(prop, "  Callback: handle=%08x str='%s'\n",
+        TRACE(prop, "  Callback: handle=%08x str='%s'\n",
                       prop->handle, prop->string );
         ret = func( hwnd, SEGPTR_GET(prop->string), prop->handle );
         if (!ret) break;
@@ -306,7 +306,7 @@
     WND *pWnd;
     INT32 ret = -1;
 
-    dprintf_info(prop, "EnumPropsEx32A: %04x %08x %08lx\n",
+    TRACE(prop, "%04x %08x %08lx\n",
                   hwnd, (UINT32)func, lParam );
     if (!(pWnd = WIN_FindWndPtr( hwnd ))) return -1;
     for (prop = pWnd->pProp; (prop); prop = next)
@@ -315,7 +315,7 @@
         /* function removes the current property.    */
         next = prop->next;
 
-        dprintf_info(prop, "  Callback: handle=%08x str='%s'\n",
+        TRACE(prop, "  Callback: handle=%08x str='%s'\n",
                       prop->handle, prop->string );
         ret = func( hwnd, prop->string, prop->handle, lParam );
         if (!ret) break;
@@ -333,7 +333,7 @@
     WND *pWnd;
     INT32 ret = -1;
 
-    dprintf_info(prop, "EnumPropsEx32W: %04x %08x %08lx\n",
+    TRACE(prop, "%04x %08x %08lx\n",
                   hwnd, (UINT32)func, lParam );
     if (!(pWnd = WIN_FindWndPtr( hwnd ))) return -1;
     for (prop = pWnd->pProp; (prop); prop = next)
@@ -342,7 +342,7 @@
         /* function removes the current property.    */
         next = prop->next;
 
-        dprintf_info(prop, "  Callback: handle=%08x str='%s'\n",
+        TRACE(prop, "  Callback: handle=%08x str='%s'\n",
                       prop->handle, prop->string );
         if (HIWORD(prop->string))
         {
diff --git a/windows/queue.c b/windows/queue.c
index d305334..44b0ec5 100644
--- a/windows/queue.c
+++ b/windows/queue.c
@@ -122,7 +122,7 @@
     int queueSize;
     TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
 
-    dprintf_info(msg,"Creating message queue...\n");
+    TRACE(msg,"Creating message queue...\n");
 
     queueSize = sizeof(MESSAGEQUEUE) + size * sizeof(QMSG);
     if (!(hQueue = GlobalAlloc16( GMEM_FIXED | GMEM_ZEROINIT, queueSize )))
@@ -152,11 +152,11 @@
     HQUEUE16  senderQ;
     HQUEUE16 *pPrev;
 
-    dprintf_info(msg,"Deleting message queue %04x\n", hQueue);
+    TRACE(msg,"Deleting message queue %04x\n", hQueue);
 
     if (!hQueue || !msgQueue)
     {
-	dprintf_warn(msg, "DeleteMsgQueue: invalid argument.\n");
+	WARN(msg, "invalid argument.\n");
 	return 0;
     }
     if( pCursorQueue == msgQueue ) pCursorQueue = NULL;
@@ -223,7 +223,7 @@
  */
 void QUEUE_SetWakeBit( MESSAGEQUEUE *queue, WORD bit )
 {
-    dprintf_info(msg,"SetWakeBit: queue = %04x (wm=%04x), bit = %04x\n", 
+    TRACE(msg,"queue = %04x (wm=%04x), bit = %04x\n", 
 	                queue->self, queue->wakeMask, bit );
 
     if (bit & QS_MOUSE) pMouseQueue = queue;
@@ -257,7 +257,7 @@
 {
     MESSAGEQUEUE *queue;
 
-    dprintf_info(msg,"WaitBits: q %04x waiting for %04x\n", GetTaskQueue(0), bits);
+    TRACE(msg,"q %04x waiting for %04x\n", GetTaskQueue(0), bits);
 
     for (;;)
     {
@@ -281,7 +281,7 @@
         queue->wakeMask = bits | QS_SENDMESSAGE;
 	if(queue->changeBits & bits) continue;
 	
-	dprintf_info(msg,"wb: (%04x) wakeMask is %04x, waiting\n", queue->self, queue->wakeMask);
+	TRACE(msg,"%04x) wakeMask is %04x, waiting\n", queue->self, queue->wakeMask);
 
         WaitEvent( 0 );
     }
@@ -300,10 +300,10 @@
     QSMCTRL*      prevCtrlPtr = NULL;
     LRESULT       result = 0;
 
-    dprintf_info(msg, "ReceiveMessage, queue %04x\n", queue->self );
+    TRACE(msg, "ReceiveMessage, queue %04x\n", queue->self );
     if (!(queue->wakeBits & QS_SENDMESSAGE) ||
         !(senderQ = (MESSAGEQUEUE*)GlobalLock16( queue->hSendingTask))) 
-	{ dprintf_info(msg,"\trcm: nothing to do\n"); return; }
+	{ TRACE(msg,"\trcm: nothing to do\n"); return; }
 
     if( !senderQ->hPrevSendingTask )
     {
@@ -320,11 +320,11 @@
     queue->smResultCurrent     = senderQ->smResultInit;
     queue->hSendingTask	       = senderQ->hPrevSendingTask;
 
-    dprintf_info(msg, "\trcm: smResultCurrent = %08x, prevCtrl = %08x\n", 
+    TRACE(msg, "\trcm: smResultCurrent = %08x, prevCtrl = %08x\n", 
 				(unsigned)queue->smResultCurrent, (unsigned)prevCtrlPtr );
     QUEUE_SetWakeBit( senderQ, QS_SMPARAMSFREE );
 
-    dprintf_info(msg, "\trcm: calling wndproc - %04x %04x %04x%04x %08x\n",
+    TRACE(msg, "\trcm: calling wndproc - %04x %04x %04x%04x %08x\n",
                 senderQ->hWnd, senderQ->msg, senderQ->wParamHigh,
                 senderQ->wParam, (unsigned)senderQ->lParam );
 
@@ -337,7 +337,7 @@
         if (senderQ->flags & QUEUE_SM_WIN32)
         {
             WPARAM32 wParam = MAKELONG( senderQ->wParam, senderQ->wParamHigh );
-            dprintf_info(msg, "\trcm: msg is Win32\n" );
+            TRACE(msg, "\trcm: msg is Win32\n" );
             if (senderQ->flags & QUEUE_SM_UNICODE)
                 result = CallWindowProc32W( wndPtr->winproc,
                                             senderQ->hWnd, senderQ->msg,
@@ -353,9 +353,9 @@
                                        senderQ->wParam, senderQ->lParam );
 
         queue->GetMessageExtraInfoVal = extraInfo;  /* Restore extra info */
-	dprintf_info(msg,"\trcm: result =  %08x\n", (unsigned)result );
+	TRACE(msg,"\trcm: result =  %08x\n", (unsigned)result );
     }
-    else dprintf_warn(msg, "\trcm: bad hWnd\n");
+    else WARN(msg, "\trcm: bad hWnd\n");
 
     /* Return the result to the sender task */
     ReplyMessage16( result );
@@ -363,7 +363,7 @@
     queue->InSendMessageHandle = prevSender;
     queue->smResultCurrent     = prevCtrlPtr;
 
-    dprintf_info(msg,"ReceiveMessage: done!\n");
+    TRACE(msg,"done!\n");
 }
 
 /***********************************************************************
@@ -447,7 +447,7 @@
 {
     int i, pos = msgQueue->nextMessage;
 
-    dprintf_info(msg,"QUEUE_FindMsg: hwnd=%04x pos=%d\n", hwnd, pos );
+    TRACE(msg,"hwnd=%04x pos=%d\n", hwnd, pos );
 
     if (!msgQueue->msgCount) return -1;
     if (!hwnd && !first && !last) return pos;
@@ -538,7 +538,7 @@
       }
       if( !queue )
       { 
-        dprintf_warn(msg, "WakeSomeone: couldn't find queue\n"); 
+        WARN(msg, "couldn't find queue\n"); 
         return; 
       }
     }
@@ -734,13 +734,13 @@
     HQUEUE16 hQueue, hNewQueue;
     MESSAGEQUEUE *queuePtr;
 
-    dprintf_info(msg,"SetMessageQueue: task %04x size %i\n", GetCurrentTask(), size); 
+    TRACE(msg,"task %04x size %i\n", GetCurrentTask(), size); 
 
     if ((size > MAX_QUEUE_SIZE) || (size <= 0)) return TRUE;
 
     if( !(hNewQueue = QUEUE_CreateMsgQueue( size ))) 
     {
-	dprintf_warn(msg, "SetMessageQueue: failed!\n");
+	WARN(msg, "failed!\n");
 	return FALSE;
     }
     queuePtr = (MESSAGEQUEUE *)GlobalLock16( hNewQueue );
diff --git a/windows/scroll.c b/windows/scroll.c
index c656d57..9682082 100644
--- a/windows/scroll.c
+++ b/windows/scroll.c
@@ -50,7 +50,7 @@
     HWND32 	hCaretWnd = CARET_GetHwnd();
     WND*	wndScroll = WIN_FindWndPtr( hwnd );
 
-    dprintf_info(scroll,"ScrollWindow: hwnd=%04x, dx=%d, dy=%d, lpRect =%p clipRect=%i,%i,%i,%i\n", 
+    TRACE(scroll,"hwnd=%04x, dx=%d, dy=%d, lpRect =%p clipRect=%i,%i,%i,%i\n", 
                    hwnd, dx, dy, rect,
                    clipRect ? clipRect->left : 0,
                    clipRect ? clipRect->top : 0,
@@ -105,7 +105,7 @@
     }
 
     PAINT_RedrawWindow( hwnd, NULL, hrgnUpdate, RDW_ALLCHILDREN |
-			    RDW_INVALIDATE, RDW_C_USEHRGN );
+                 RDW_INVALIDATE | RDW_ERASE | RDW_ERASENOW, RDW_C_USEHRGN );
 
     DeleteObject32( hrgnUpdate );
     if( hCaretWnd ) 
@@ -156,7 +156,7 @@
     INT32  ldx, ldy;
     DC *dc = (DC *)GDI_GetObjPtr(hdc, DC_MAGIC);
 
-    dprintf_info(scroll,"ScrollDC: %04x %d,%d hrgnUpdate=%04x rcUpdate = %p cliprc = (%d,%d-%d,%d), rc=(%d,%d-%d,%d)\n",
+    TRACE(scroll,"%04x %d,%d hrgnUpdate=%04x rcUpdate = %p cliprc = (%d,%d-%d,%d), rc=(%d,%d-%d,%d)\n",
                    (HDC16)hdc, dx, dy, hrgnUpdate, rcUpdate, 
 		   prLClip ? prLClip->left : 0, prLClip ? prLClip->top : 0, prLClip ? prLClip->right : 0, prLClip ? prLClip->bottom : 0,
 		   rc ? rc->left : 0, rc ? rc->top : 0, rc ? rc->right : 0, rc ? rc->bottom : 0 );
@@ -373,7 +373,7 @@
 	BOOL32  bUpdate = (rcUpdate || hrgnUpdate || flags & (SW_INVALIDATE | SW_ERASE));
 	HRGN32  hrgnClip = CreateRectRgnIndirect32(&cliprc);
 
-dprintf_info(scroll,"ScrollWindowEx: %04x, %d,%d hrgnUpdate=%04x rcUpdate = %p \
+TRACE(scroll,"%04x, %d,%d hrgnUpdate=%04x rcUpdate = %p \
 cliprc = (%d,%d-%d,%d), rc=(%d,%d-%d,%d) %04x\n",             
 (HWND16)hwnd, dx, dy, hrgnUpdate, rcUpdate,
 clipRect?clipRect->left:0, clipRect?clipRect->top:0, clipRect?clipRect->right:0, clipRect?clipRect->bottom:0,
diff --git a/windows/timer.c b/windows/timer.c
index 4524573..a14aa6a 100644
--- a/windows/timer.c
+++ b/windows/timer.c
@@ -200,7 +200,7 @@
     if (!pTimer || (pTimer->expires > curTime)) return FALSE; /* No timer */
     if (remove)	TIMER_RestartTimer( pTimer, curTime );  /* Restart it */
 
-    dprintf_info(timer, "Timer expired: %04x, %04x, %04x, %08lx\n", 
+    TRACE(timer, "Timer expired: %04x, %04x, %04x, %08lx\n", 
 		   pTimer->hwnd, pTimer->msg, pTimer->id, (DWORD)pTimer->proc);
 
       /* Build the message */
@@ -262,7 +262,7 @@
     pTimer->expires = GetTickCount() + timeout;
     pTimer->proc    = (HWINDOWPROC)0;
     if (proc) WINPROC_SetProc( &pTimer->proc, proc, type, WIN_PROC_TIMER );
-    dprintf_info(timer, "Timer added: %p, %04x, %04x, %04x, %08lx\n", 
+    TRACE(timer, "Timer added: %p, %04x, %04x, %04x, %08lx\n", 
 		   pTimer, pTimer->hwnd, pTimer->msg, pTimer->id,
                    (DWORD)pTimer->proc );
     TIMER_InsertTimer( pTimer );
@@ -302,7 +302,7 @@
 UINT16 WINAPI SetTimer16( HWND16 hwnd, UINT16 id, UINT16 timeout,
                           TIMERPROC16 proc )
 {
-    dprintf_info(timer, "SetTimer16: %04x %d %d %08lx\n",
+    TRACE(timer, "%04x %d %d %08lx\n",
                    hwnd, id, timeout, (LONG)proc );
     return TIMER_SetTimer( hwnd, id, timeout, (WNDPROC16)proc,
                            WIN_PROC_16, FALSE );
@@ -315,7 +315,7 @@
 UINT32 WINAPI SetTimer32( HWND32 hwnd, UINT32 id, UINT32 timeout,
                           TIMERPROC32 proc )
 {
-    dprintf_info(timer, "SetTimer32: %04x %d %d %08lx\n",
+    TRACE(timer, "%04x %d %d %08lx\n",
                    hwnd, id, timeout, (LONG)proc );
     return TIMER_SetTimer( hwnd, id, timeout, (WNDPROC16)proc,
                            WIN_PROC_32A, FALSE );
@@ -328,7 +328,7 @@
 UINT16 WINAPI SetSystemTimer16( HWND16 hwnd, UINT16 id, UINT16 timeout,
                                 TIMERPROC16 proc )
 {
-    dprintf_info(timer, "SetSystemTimer16: %04x %d %d %08lx\n", 
+    TRACE(timer, "%04x %d %d %08lx\n", 
                    hwnd, id, timeout, (LONG)proc );
     return TIMER_SetTimer( hwnd, id, timeout, (WNDPROC16)proc,
                            WIN_PROC_16, TRUE );
@@ -341,7 +341,7 @@
 UINT32 WINAPI SetSystemTimer32( HWND32 hwnd, UINT32 id, UINT32 timeout,
                                 TIMERPROC32 proc )
 {
-    dprintf_info(timer, "SetSystemTimer32: %04x %d %d %08lx\n", 
+    TRACE(timer, "%04x %d %d %08lx\n", 
                    hwnd, id, timeout, (LONG)proc );
     return TIMER_SetTimer( hwnd, id, timeout, (WNDPROC16)proc,
                            WIN_PROC_32A, TRUE );
@@ -353,7 +353,7 @@
  */
 BOOL16 WINAPI KillTimer16( HWND16 hwnd, UINT16 id )
 {
-    dprintf_info(timer, "KillTimer16: %04x %d\n", hwnd, id );
+    TRACE(timer, "%04x %d\n", hwnd, id );
     return TIMER_KillTimer( hwnd, id, FALSE );
 }
 
@@ -363,7 +363,7 @@
  */
 BOOL32 WINAPI KillTimer32( HWND32 hwnd, UINT32 id )
 {
-    dprintf_info(timer, "KillTimer32: %04x %d\n", hwnd, id );
+    TRACE(timer, "%04x %d\n", hwnd, id );
     return TIMER_KillTimer( hwnd, id, FALSE );
 }
 
@@ -373,7 +373,7 @@
  */
 BOOL16 WINAPI KillSystemTimer16( HWND16 hwnd, UINT16 id )
 {
-    dprintf_info(timer, "KillSystemTimer16: %04x %d\n", hwnd, id );
+    TRACE(timer, "%04x %d\n", hwnd, id );
     return TIMER_KillTimer( hwnd, id, TRUE );
 }
 
@@ -383,6 +383,6 @@
  */
 BOOL32 WINAPI KillSystemTimer32( HWND32 hwnd, UINT32 id )
 {
-    dprintf_info(timer, "KillSystemTimer32: %04x %d\n", hwnd, id );
+    TRACE(timer, "%04x %d\n", hwnd, id );
     return TIMER_KillTimer( hwnd, id, TRUE );
 }
diff --git a/windows/user.c b/windows/user.c
index f7aea01..1c42131 100644
--- a/windows/user.c
+++ b/windows/user.c
@@ -325,3 +325,28 @@
 	fprintf(stderr, "SetEventHook(lpfnEventHook = %08x): stub !\n", (UINT32)lpfnEventHook);
 	return NULL;
 }
+
+/***********************************************************************
+ *           UserSeeUserDo   (USER.216)
+ */
+DWORD WINAPI UserSeeUserDo(WORD wReqType, WORD wParam1, WORD wParam2, WORD wParam3)
+{
+    switch (wReqType)
+    {
+    case USUD_LOCALALLOC:
+        return LOCAL_Alloc(USER_HeapSel, wParam1, wParam3);
+    case USUD_LOCALFREE:
+        return LOCAL_Free(USER_HeapSel, wParam1);
+    case USUD_LOCALCOMPACT:
+        return LOCAL_Compact(USER_HeapSel, wParam3, 0);
+    case USUD_LOCALHEAP:
+        return USER_HeapSel;
+    case USUD_FIRSTCLASS:
+        FIXME(local, "return a pointer to the first window class.\n"); 
+        return (DWORD)-1;
+    default:
+        WARN(local, "wReqType %04x (unknown)", wReqType);
+        return (DWORD)-1;
+    }
+}
+
diff --git a/windows/win.c b/windows/win.c
index d431b51..e0412db 100644
--- a/windows/win.c
+++ b/windows/win.c
@@ -235,7 +235,7 @@
     {
         if (!(pWnd->dwStyle & WS_VISIBLE))
         {
-            dprintf_info(win, "FindWinToRepaint: skipping window %04x\n",
+            TRACE(win, "skipping window %04x\n",
                          pWnd->hwndSelf );
             continue;
         }
@@ -258,7 +258,7 @@
         pWnd = pWnd->next;
     }
     if (pWnd) hwndRet = pWnd->hwndSelf;
-    dprintf_info(win,"FindWinToRepaint: found %04x\n",hwndRet);
+    TRACE(win,"found %04x\n",hwndRet);
     return hwndRet;
 }
 
@@ -273,7 +273,7 @@
     HWND32 hwnd = wndPtr->hwndSelf;
     WND *pWnd;
 
-    dprintf_info(win, "WIN_DestroyWindow: %04x\n", wndPtr->hwndSelf );
+    TRACE(win, "%04x\n", wndPtr->hwndSelf );
 
 #ifdef CONFIG_IPC
     if (main_block)
@@ -403,7 +403,7 @@
     CLASS *class;
     HWND32 hwndDesktop;
 
-    dprintf_info(win,"Creating desktop window\n");
+    TRACE(win,"Creating desktop window\n");
 
     if (!ICONTITLE_Init() ||
 	!WINPOS_CreateInternalPosAtom() ||
@@ -467,7 +467,7 @@
     POINT32 maxSize, maxPos, minTrack, maxTrack;
     LRESULT (WINAPI *localSend32)(HWND32, UINT32, WPARAM32, LPARAM);
 
-    dprintf_info(win, "CreateWindowEx: %s %s %08lx %08lx %d,%d %dx%d "
+    TRACE(win, "%s %s %08lx %08lx %d,%d %dx%d "
 		 "%04x %04x %08x %p\n", debugres(cs->lpszName), 
 		 debugres(cs->lpszClass), cs->dwExStyle, 
 		 cs->style, cs->x, cs->y, cs->cx, cs->cy,
@@ -515,7 +515,7 @@
     if (!(hwnd = USER_HEAP_ALLOC( sizeof(*wndPtr) + classPtr->cbWndExtra
                                   - sizeof(wndPtr->wExtra) )))
     {
-	dprintf_info(win, "CreateWindowEx: out of memory\n" );
+	TRACE(win, "out of memory\n" );
 	return 0;
     }
 
@@ -574,7 +574,7 @@
 	cbtc.hwndInsertAfter = hwndLinkAfter;
 	if ( HOOK_CallHooks32A(WH_CBT, HCBT_CREATEWND, hwnd, (LPARAM)&cbtc) )
 	{
-	    dprintf_info(win, "CreateWindowEx: CBT-hook returned 0\n");
+	    TRACE(win, "CBT-hook returned 0\n");
 	    USER_HEAP_FREE( hwnd );
 	    return 0;
 	}
@@ -776,14 +776,14 @@
             if (!(wndPtr->dwStyle & WS_CHILD) && !wndPtr->owner)
                 HOOK_CallHooks16( WH_SHELL, HSHELL_WINDOWCREATED, hwnd, 0 );
 
-            dprintf_info(win, "CreateWindowEx: created window %04x\n", hwnd);
+            TRACE(win, "created window %04x\n", hwnd);
             return hwnd;
         }
     }
 
     /* Abort window creation */
 
-    dprintf_warn(win, "CreateWindowEx: aborted by WM_xxCREATE!\n");
+    WARN(win, "aborted by WM_xxCREATE!\n");
     WIN_UnlinkWindow( hwnd );
     WIN_DestroyWindow( wndPtr );
     return 0;
@@ -965,7 +965,7 @@
 	WIN_CheckFocus(pWnd);
     }
     else
-	dprintf_warn(win, "\tdestroyed itself while in WM_DESTROY!\n");
+	WARN(win, "\tdestroyed itself while in WM_DESTROY!\n");
 }
 
 
@@ -985,7 +985,7 @@
 {
     WND * wndPtr;
 
-    dprintf_info(win, "DestroyWindow(%04x)\n", hwnd);
+    TRACE(win, "(%04x)\n", hwnd);
     
       /* Initialization */
 
@@ -1188,7 +1188,7 @@
 {
     ATOM atom = 0;
 
-    dprintf_info(win, "FindWindowEx16: %04x %04x '%s' '%s'\n", parent,
+    TRACE(win, "%04x %04x '%s' '%s'\n", parent,
 		child, HIWORD(className)?(char *)PTR_SEG_TO_LIN(className):"",
 		title ? title : "");
 
@@ -2239,7 +2239,7 @@
 {
     WND *wndPtr = WIN_FindWndPtr(hWnd);
 
-    dprintf_info(win,"FlashWindow: %04x\n", hWnd);
+    TRACE(win,"%04x\n", hWnd);
 
     if (!wndPtr) return FALSE;
 
@@ -2282,7 +2282,7 @@
 {
     HWND32 hWndOldModal = hwndSysModal;
     hwndSysModal = hWnd;
-    dprintf_fixme(win, "EMPTY STUB !! SetSysModalWindow(%04x) !\n", hWnd);
+    FIXME(win, "EMPTY STUB !! SetSysModalWindow(%04x) !\n", hWnd);
     return hWndOldModal;
 }
 
@@ -2340,7 +2340,7 @@
 
 	 if(ptrWnd)
          {
-	    dprintf_info(msg,"DragQueryUpdate: hwnd = %04x, %d %d - %d %d\n",
+	    TRACE(msg,"hwnd = %04x, %d %d - %d %d\n",
                         ptrWnd->hwndSelf, ptrWnd->rectWindow.left, ptrWnd->rectWindow.top,
 			ptrWnd->rectWindow.right, ptrWnd->rectWindow.bottom );
             if( !(ptrWnd->dwStyle & WS_DISABLED) )
@@ -2479,7 +2479,7 @@
 	lpDragInfo->pt = msg.pt;
 
 	/* update DRAGINFO struct */
-	dprintf_info(msg,"drag: lpDI->hScope = %04x\n",lpDragInfo->hScope);
+	TRACE(msg,"lpDI->hScope = %04x\n",lpDragInfo->hScope);
 
 	if( DRAG_QueryUpdate(hwndScope, spDragInfo, FALSE) > 0 )
 	    hCurrentCursor = hCursor;
diff --git a/windows/winpos.c b/windows/winpos.c
index 53b4ed5..7603807 100644
--- a/windows/winpos.c
+++ b/windows/winpos.c
@@ -85,7 +85,7 @@
     if( hwnd == hwndActive )
     {
 	hwndActive = 0; 
-	dprintf_warn(win, "\tattempt to activate destroyed window!\n");
+	WARN(win, "\tattempt to activate destroyed window!\n");
     }
 
     if( lpPos )
@@ -723,7 +723,7 @@
 {    
     int flags = SWP_NOZORDER | SWP_NOACTIVATE;
     if (!repaint) flags |= SWP_NOREDRAW;
-    dprintf_info(win, "MoveWindow: %04x %d,%d %dx%d %d\n", 
+    TRACE(win, "%04x %d,%d %dx%d %d\n", 
 	    hwnd, x, y, cx, cy, repaint );
     return SetWindowPos32( hwnd, 0, x, y, cx, cy, flags );
 }
@@ -789,7 +789,7 @@
     {
 	HWND16 hWnd = lpPos->hwndIconTitle;
 
-	dprintf_info(win,"ShowIconTitle: 0x%04x %i\n", pWnd->hwndSelf, (bShow != 0) );
+	TRACE(win,"0x%04x %i\n", pWnd->hwndSelf, (bShow != 0) );
 
 	if( !hWnd )
 	    lpPos->hwndIconTitle = hWnd = ICONTITLE_Create( pWnd );
@@ -866,7 +866,7 @@
 
       /* Some sanity checks */
 
-    dprintf_info(win,"GetMinMaxInfo: %d %d / %d %d / %d %d / %d %d\n",
+    TRACE(win,"%d %d / %d %d / %d %d / %d %d\n",
                       MinMax.ptMaxSize.x, MinMax.ptMaxSize.y,
                       MinMax.ptMaxPosition.x, MinMax.ptMaxPosition.y,
                       MinMax.ptMaxTrackSize.x, MinMax.ptMaxTrackSize.y,
@@ -897,7 +897,7 @@
     LPINTERNALPOS lpPos = WINPOS_InitInternalPos( wndPtr, size,
                                                   &wndPtr->rectWindow );
 
-    dprintf_info(win,"MinMaximize: 0x%04x %u\n", wndPtr->hwndSelf, cmd );
+    TRACE(win,"0x%04x %u\n", wndPtr->hwndSelf, cmd );
 
     if (lpPos && !HOOK_CallHooks16(WH_CBT, HCBT_MINMAX, wndPtr->hwndSelf, cmd))
     {
@@ -995,7 +995,7 @@
 
     if (!wndPtr) return FALSE;
 
-    dprintf_info(win,"ShowWindow: hwnd=%04x, cmd=%d\n", hwnd, cmd);
+    TRACE(win,"hwnd=%04x, cmd=%d\n", hwnd, cmd);
 
     wasVisible = (wndPtr->dwStyle & WS_VISIBLE) != 0;
 
@@ -1373,7 +1373,7 @@
     if( (wndTemp = WIN_FindWndPtr(hwndActive)) )
 	wIconized = HIWORD(wndTemp->dwStyle & WS_MINIMIZE);
     else
-	dprintf_info(win,"WINPOS_ActivateWindow: no current active window.\n");
+	TRACE(win,"no current active window.\n");
 
     /* call CBT hook chain */
     if ((cbtStruct = SEGPTR_NEW(CBTACTIVATESTRUCT16)))
@@ -1615,7 +1615,7 @@
     }
     result = SendMessage32A( hwnd, WM_NCCALCSIZE, calcValidRect,
                              (LPARAM)&params );
-    dprintf_info(win, "WINPOS_SendNCCalcSize: %d,%d-%d,%d\n",
+    TRACE(win, "%d,%d-%d,%d\n",
                  params.rgrc[0].left, params.rgrc[0].top,
                  params.rgrc[0].right, params.rgrc[0].bottom );
     *newClientRect = params.rgrc[0];
@@ -1815,16 +1815,16 @@
  HRGN32 dirtyRgn = CreateRectRgn32(0,0,0,0);
  int  other, my;
 
- dprintf_info(win,"cleaning up...new wnd=(%i %i-%i %i) old wnd=(%i %i-%i %i)\n\
-\t\tnew client=(%i %i-%i %i) old client=(%i %i-%i %i)\n",
-             Wnd->rectWindow.left, Wnd->rectWindow.top,
-             Wnd->rectWindow.right, Wnd->rectWindow.bottom,
-             lpOldWndRect->left, lpOldWndRect->top,
-             lpOldWndRect->right, lpOldWndRect->bottom,
-             Wnd->rectClient.left, Wnd->rectClient.top,
-             Wnd->rectClient.right, Wnd->rectClient.bottom,
-             lpOldClientRect->left, lpOldClientRect->top,
-             lpOldClientRect->right,lpOldClientRect->bottom );
+ TRACE(win,"cleaning up...new wnd=(%i %i-%i %i) old wnd=(%i %i-%i %i)\n",
+	      Wnd->rectWindow.left, Wnd->rectWindow.top,
+	      Wnd->rectWindow.right, Wnd->rectWindow.bottom,
+	      lpOldWndRect->left, lpOldWndRect->top,
+	      lpOldWndRect->right, lpOldWndRect->bottom);
+ TRACE(win,"\tnew client=(%i %i-%i %i) old client=(%i %i-%i %i)\n",
+	      Wnd->rectClient.left, Wnd->rectClient.top,
+	      Wnd->rectClient.right, Wnd->rectClient.bottom,
+	      lpOldClientRect->left, lpOldClientRect->top,
+	      lpOldClientRect->right,lpOldClientRect->bottom );
 
  if( (lpOldWndRect->right - lpOldWndRect->left) != (Wnd->rectWindow.right - Wnd->rectWindow.left) ||
      (lpOldWndRect->bottom - lpOldWndRect->top) != (Wnd->rectWindow.bottom - Wnd->rectWindow.top) )
@@ -2055,7 +2055,7 @@
     int 	result = 0;
     UINT32 	uFlags = 0;
 
-    dprintf_info(win,"SetWindowPos: hwnd %04x, (%i,%i)-(%i,%i) flags %08x\n", 
+    TRACE(win,"hwnd %04x, (%i,%i)-(%i,%i) flags %08x\n", 
 						 hwnd, x, y, x+cx, y+cy, flags);  
       /* Check window handle */
 
@@ -2190,16 +2190,14 @@
 
          /* FIXME: WVR_ALIGNxxx */
 
-         if( !(winpos.flags & SWP_NOMOVE) &&
-	     (newClientRect.left != wndPtr->rectClient.left ||
-	      newClientRect.top != wndPtr->rectClient.top) )
+         if( newClientRect.left != wndPtr->rectClient.left ||
+             newClientRect.top != wndPtr->rectClient.top )
              winpos.flags &= ~SWP_NOCLIENTMOVE;
 
-         if( !(winpos.flags & SWP_NOSIZE) &&
-	     ((newClientRect.right - newClientRect.left !=
-	       wndPtr->rectClient.right - wndPtr->rectClient.left) ||
-	      (newClientRect.bottom - newClientRect.top !=
-	       wndPtr->rectClient.bottom - wndPtr->rectClient.top)) )
+         if( (newClientRect.right - newClientRect.left !=
+              wndPtr->rectClient.right - wndPtr->rectClient.left) ||
+	     (newClientRect.bottom - newClientRect.top !=
+	      wndPtr->rectClient.bottom - wndPtr->rectClient.top) )
 	     winpos.flags &= ~SWP_NOCLIENTSIZE;
     }
     else
@@ -2398,7 +2396,7 @@
 
       /* And last, send the WM_WINDOWPOSCHANGED message */
 
-    dprintf_info(win,"\tstatus flags = %04x\n", winpos.flags & SWP_AGG_STATUSFLAGS);
+    TRACE(win,"\tstatus flags = %04x\n", winpos.flags & SWP_AGG_STATUSFLAGS);
 
     if ( ((winpos.flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOPOSCHANGE) && 
 	 !(winpos.flags & SWP_NOSENDCHANGING))
diff --git a/windows/winproc.c b/windows/winproc.c
index 1474a77..3b627de 100644
--- a/windows/winproc.c
+++ b/windows/winproc.c
@@ -114,7 +114,7 @@
 static LRESULT WINPROC_CallWndProc32( WNDPROC32 proc, HWND32 hwnd, UINT32 msg,
                                       WPARAM32 wParam, LPARAM lParam )
 {
-    dprintf_info(relay, "CallTo32(wndproc=%p,hwnd=%08x,msg=%08x,wp=%08x,lp=%08lx)\n",
+    TRACE(relay, "(wndproc=%p,hwnd=%08x,msg=%08x,wp=%08x,lp=%08lx)\n",
                    proc, hwnd, msg, wParam, lParam );
     return proc( hwnd, msg, wParam, lParam );
 }
@@ -224,7 +224,7 @@
         proc->user  = user;
     }
     proc->next  = NULL;
-    dprintf_info(win, "WINPROC_AllocWinProc(%08x,%d): returning %08x\n",
+    TRACE(win, "(%08x,%d): returning %08x\n",
                  (UINT32)func, type, (UINT32)proc );
     return proc;
 }
@@ -339,7 +339,7 @@
 
     /* Add the win proc at the head of the list */
 
-    dprintf_info(win, "WINPROC_SetProc(%08x,%08x,%d): res=%08x\n",
+    TRACE(win, "(%08x,%08x,%d): res=%08x\n",
                  (UINT32)*pFirst, (UINT32)func, type, (UINT32)proc );
     proc->next  = *(WINDOWPROC **)pFirst;
     *(WINDOWPROC **)pFirst = proc;
@@ -358,7 +358,7 @@
     {
         WINDOWPROC *next = ((WINDOWPROC *)proc)->next;
         if (((WINDOWPROC *)proc)->user != user) break;
-        dprintf_info(win, "WINPROC_FreeProc: freeing %08x\n", (UINT32)proc);
+        TRACE(win, "freeing %08x\n", (UINT32)proc);
         HeapFree( WinProcHeap, 0, proc );
         proc = next;
     }