Release 980809

Sat Aug  8 19:11:46 1998  Marcus Meissner <marcus@jet.franken.de>

 	* [*/*]
	Added some missing WINAPI and some missing prototypes for
	functions.

	* [controls/static.c]
	Got rid of the MODULE32_LookupHMODULE error showing up for every
	message box.

	* [windows/winproc.c]
	WM_NOTIFY 16->32 mapping (AOL Instant Messenger or however it is called).

	* [misc/winsock.c]
	hostent/servent/protoent should not use the same static buffers.
	(has broken nt3.15 finger.exe which does hp=gethostbyname(), then
	getservbyname("finger","tcp") and the references hp->h_addr_list[0]).

Sat Aug  8 13:21:24 1998  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [include/server.h] [tools/make_requests] [server/request.c]
	  [server/trace.c]
	Automated part of the client/server request code generation.
	Added tracing of client/server communication.

	* [scheduler/*.c] [server/process.c]
	Added support for server-side handles.

	* [scheduler/thread.c]
	Added DLL_THREAD_ATTACH/DETACH notifications.

	* [configure.in]
	Added check for -lsocket.

	* [windows/winproc.c]
	Return the thunk address in WINPROC_GetProc if the function types
	don't match.

Sat Aug  8 02:44:04 1998  Douglas Ridgway  <ridgway@winehq.com>

	* [windows/winproc.c][windows/win.c][windows/message.c]  
	Documentation for CallWindowProc, SetWindowLong, DispatchMessage,
	WaitMessage, GetMessage, and PeekMessage.

Sat Aug  8 01:00:00 1998  Juergen Schmied <juergen.schmied@metronet.de>

	* [controls/commctrl.c][controls/widgets.c][include/builtin32.h]
	  [include/commctrl.h][relay32/builtin32.c][relay32/comctl32.spec]
	  [tools/build.c] [relay32/shell32.spec]
	Added the functionality of the LibMain function. The common 
	controls are properly initialized now.

	* [controls/treeview.c][memory/atom.c][scheduler/thread.c][windows/class.c]
	  [windows/msgbox.c][windows/win.c]
	Put TRACE in, put SetLastError() in.

	* [include/interfaces.h]
	Added IClassFactory::LockServer.

	* [include/ole2.h]
	Added struct for LPOLEMENUGROUPWIDTHS32, HOLEMENU32.

	* [include/shell.h][include/shlobj.h][misc/shell.c][ole/folders.c]
	Reorganized and many structs and classes (IShellBrowser,IShellView)
	added. shell32.dll should work in many cases now.
	Started SHGetFileInfoA implementeation, rewrote SHGetPathFromIDList32A.
	New Shell32LibMain started ShellIconCache Implementation.

	* [misc/shellord.c]
	Rewrote ILCombine, ILGetSize
	New stubs SHFind_InitMenuPopup, FileMenu_Create, ShellExecuteEx,
	SHSetInstanceExplorer, SHGetInstanceExplorer, SHFreeUnusedLibraries.

	* [include/winerror.h]
	Class and window related error codes added.

	* [memory/heap.c]
	Changed lstrlen32A to strlen to get rid of milions of TRACE lines.

	* [misc/ddeml.c]
	First lines for DdeCreateStringHandle32A / DdeFreeStringHandle32.

	* [misc/network.c][relay32/mpr.spec]
	Fixed some bugs, changed ordinals.

	* [windows/class.c]
	Workarounds for incorrect hInstance handling. Fixes parts of
	MSWord95/Excel95 and Money95.

Thu Aug  6 21:05:35 1998  Eric Kohl <ekohl@abo.rhein-zeitung.de>

	* [windows/nonclient.c][misc/tweak.c][include/tweak.h]
	  [documentation/win95look]
	Removed some tweak variables. They are no longer needed.

	* [files/dos_fs.c]
	Added check for null pointer in DOSFS_GetDevice().

	* [controls/tooltips.c][include/commctrl.h]
	Improved tooltips.

	* [controls/status.c][include/commctrl.h]
	Cleaned up code and added tooltip support.

	* [controls/toolbar.c][include/commctrl.h]
	Added tooltip support.

	* [documentation/common_controls]
	Updated.

Thu Aug  6 00:05:22 1998  Uwe Bonnes  <bon@elektron.ikp.physik.tu-darmstadt.de>

	* [include/ver.h] [misc/ver.c]
	Write VIF_BUFFTOOSMALL, not VIF_BUFTOSMALL.

	* [debugger/hash.c] [debugger/stabs.c]
	Make debug output more friendly for posting.

	* [files/file.c]
	Partial implementation of OF_SHARE_EXCLUSIVE.
	Needed for Quicklogic/QuickChip (InstallShield).

	* [files/profile.c]
	When a cached-only entry is found, return it.

	* [graphics/x11drv/xfont.c]
	Accept a space as delimiter for a fontname and inhibit overrun
	(Make xplasim.ex from the Phillips Coolrunner CPLD suite proceed).

	* [miscemu/main.c]
	Delay setting IF1632_CallLargeStack after loading the executables.
	Stops fpgaexp.exe from the Viewlogic FPGA suite from crashing when
 	showing the Blinker error Message Box.

	* [misc/network.c]
	Make WNetGetConnection16 recognise a CDROM as a local drive.

	* [multimedia/mmsystem.c]
	Preliminary check for MCI_ALL_DEVICE_ID in MCI_Close by a FIXME.


Tue Aug 4 21:15:23 1998  James Juran <jrj120@psu.edu>

	* [ole/ole2nls.c]
	Fixed bug in CompareString32A.  strcmp() doesn't necessarily
	return -1, 0, or 1, which the previous code depended on.
	Changed name of is_punctuation to OLE2NLS_isPunctuation.
	Made NORM_IGNOREWIDTH not print a FIXME message in 
	LCMapString32A.
	Other debugging messages, documentation, and code cleanups.

	* [objects/font.c] [relay32/gdi32.spec] [include/winerror.h]
	Added stub for GetFontData32, and added GDI_ERROR constant 
	to winerror.h.

Tue Aug  4 07:44:43 1998  Ove Kaaven <ovek@arcticnet.no>

	* [multimedia/mmio.c]
	Implemented mmioSetBuffer, mmioAdvance, mmioAscend, and
	mmioCreateChunk to the best of my knowledge. But watch out,
	there's bound to be bugs in there...

	* [include/mmsystem.h] [multimedia/mmsystem.c]
	Hacked in support for 32-bit multimedia function callbacks.

	* [AUTHORS] [misc/shell.c]
	Selfishly credited my authorship. Hopefully I'm excused.

	* [include/dosexe.h] [include/module.h] [loader/dos/*]
	  [loader/module.c] [loader/task.c] [Makefile.in]
	  [configure.in] [Makefile.in]
	Added DOS EXE (MZ) loader and virtual machine. Task
	structure integration thanks to Ulrich Weigand.

	* [files/dos_fs.c]
	Work around a null pointer dereference if ioctlGetDeviceInfo-ing
	a FILE_DupUnixHandle'd file (i.e. GetStdHandle'd).

	* [include/miscemu.h] [include/winnt.h] [loader/main.c]
	  [memory/global.c] [msdos/dpmi.c] [msdos/dosmem.c]
	Added support for DOS memory images, and added
	DOSMEM_ResizeBlock() and DOSMEM_Available().

	* [msdos/int21.c]
	Added support for the DOS virtual machine, tweaked handle
	assignment to avoid stdio clashes, forced INT21_FindNext to exit
	wildcardless searches after finding one entry, added AH=7, 8, 9,
	C, 48, 49, 4A, and 7160 CL=1 (Get Short Filename), and made the
	long filename calls only respond if running with with -winver
	win95.

	* [objects/cursoricon.c]
	DestroyCursor32 and DestroyIcon32 should now free the objects
	(hopefully) correctly.

Sun Aug  2 21:42:09 1998  Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>

	* [graphics/psdrv/*] [include/psdrv.h]
	Added PPD file parsing - at the moment it reads a file called
	default.ppd from the directory in which you start Wine. Page sizes
	other than A4 should now work (landscape may not). All fonts that are
	present on your printer (according to the PPD) should be available,
	providing you have the AFM files. Fonts should now be the correct size.
	Graphics is still basically lines only. See graphics/psdrv/README .

	* [misc/printdrv.c]
	Yet more Drv[Get/Set]PrinterData fixes.

Fri Jul 31 21:33:22 1998  Per Lindström <pelinstr@algonet.se>

	* [relay32/crtdll.spec] [misc/crtdll.c]
	Added stub for freopen, _findfirst, _findnext, _fstat and _read.

	* [files/directory.c]
	Modified warning message.

Wed Jul 29 11:25:28 1998  Luiz Otavio L. Zorzella  <zorzella@nr.conexware.com>

	* [objects/font.c]
	Added stub for GetFontData.

	* [multimedia/msvideo.c]
	Created this file to hold the msvideo.dll calls (and maybe also
	msvfw32.dll). 

	* [objects/cursoricon.c]
	Added search in Global Heap for cursor when trying to destroy it
	with DestroyCursor16. This test should be done in many (all?)
	other functions that use FreeResource.

	* [controls/treeview.c] [include/commctrl.h]
	Minor correction in name and addition of many placeholders for TVM
	messages in TREEVIEW_WindowProc.

	* [msdos/dpmi.c]
	Fixed a bug in DPMI_xrealloc where in a copy of a memory region
	"A" of size "a" to a region "B" of size "b", "b" bytes were being
	copied, instead of "a", as the new version does. This both
	increases speed, as well as avoids segfaults.
diff --git a/windows/class.c b/windows/class.c
index b33606d..aef5cd3 100644
--- a/windows/class.c
+++ b/windows/class.c
@@ -2,10 +2,14 @@
  * Window classes functions
  *
  * Copyright 1993, 1996 Alexandre Julliard
+ *           1998 Juergen Schmied (jsch)
  *
  * FIXME: In win32 all classes are local. They are registered at 
  *	  program start. Processes CANNOT share classes. (Source: some
  *	  win31->NT migration book)
+ *
+ * FIXME: There seems to be a general problem with hInstance in WINE
+ *   classes are getting registred with wrong hInstance.
  */
 
 #include <stdlib.h>
@@ -19,6 +23,7 @@
 #include "toolhelp.h"
 #include "winproc.h"
 #include "debug.h"
+#include "winerror.h"
 
 
 static CLASS *firstClass = NULL;
@@ -160,6 +165,7 @@
 static BOOL32 CLASS_FreeClass( CLASS *classPtr )
 {
     CLASS **ppClass;
+    TRACE(class,"%p \n", classPtr);  
 
     /* Check if we can remove this class */
 
@@ -195,6 +201,8 @@
 {
     CLASS *ptr, *next;
   
+    TRACE(class,"0x%08x \n", hModule);  
+
     for (ptr = firstClass; ptr; ptr = next)
     {
         next = ptr->next;
@@ -208,19 +216,30 @@
  *
  * Return a pointer to the class.
  * hinstance has been normalized by the caller.
+ *
+ * NOTES
+ *  980805 a local class will be found now if registred with hInst=0
+ *  and looed up with a hInst!=0. msmoney does it (jsch)
  */
 CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE32 hinstance )
-{
-    CLASS * class;
+{   CLASS * class, *tclass=0;
+
+    TRACE(class,"0x%08x 0x%08x\n", atom, hinstance);
 
     /* First search task-specific classes */
 
     for (class = firstClass; (class); class = class->next)
     {
         if (class->style & CS_GLOBALCLASS) continue;
-        if ((class->atomName == atom) && 
-            ((hinstance == 0xffff) ||
-             (hinstance == class->hInstance))) return class;
+        if (class->atomName == atom)
+        {
+            if (hinstance==class->hInstance || hinstance==0xffff )
+            {
+                TRACE(class,"-- found local %p\n", class);
+                return class;
+            }
+            if (class->hInstance==0) tclass = class;
+        }
     }
     
       /* Then search global classes */
@@ -228,9 +247,21 @@
     for (class = firstClass; (class); class = class->next)
     {
         if (!(class->style & CS_GLOBALCLASS)) continue;
-        if (class->atomName == atom) return class;
+        if (class->atomName == atom)
+        {
+            TRACE(class,"-- found global %p\n", class);
+            return class;
+        }
     }
 
+    /* Then check if there was a local class with hInst=0*/
+    if ( tclass )
+    {
+        WARN(class,"-- found local Class registred with hInst=0\n");
+        return tclass;
+    }
+    
+    TRACE(class,"-- not found\n");
     return 0;
 }
 
@@ -247,8 +278,10 @@
 {
     CLASS *classPtr;
 
-    /* Check if a class with this name already exists */
+    TRACE(class,"atom=0x%x hinst=0x%x style=0x%lx clExtr=0x%x winExtr=0x%x wndProc=0x%p ProcType=0x%x\n",
+     atom, hInstance, style, classExtra, winExtra, wndProc, wndProcType);
 
+   /* Check if a class with this name already exists */
     classPtr = CLASS_FindClassByAtom( atom, hInstance );
     if (classPtr)
     {
@@ -346,18 +379,21 @@
     ATOM atom;
     CLASS *classPtr;
 
-    if (!(atom = GlobalAddAtom32A( wc->lpszClassName ))) return 0;
+    if (!(atom = GlobalAddAtom32A( wc->lpszClassName ))) 
+    {
+        SetLastError(ERROR_CLASS_ALREADY_EXISTS);
+        return FALSE;
+    }
     if (!(classPtr = CLASS_RegisterClass( atom, wc->hInstance, wc->style,
                                           wc->cbClsExtra, wc->cbWndExtra,
                                           (WNDPROC16)wc->lpfnWndProc,
                                           WIN_PROC_32A )))
-    {
-        GlobalDeleteAtom( atom );
-        return 0;
+    {   GlobalDeleteAtom( atom );
+        SetLastError(ERROR_CLASS_ALREADY_EXISTS);
+        return FALSE;
     }
 
-    TRACE(class, "atom=%04x wndproc=%08lx
-hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p name='%s'\n",
+    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,
                    wc->cbWndExtra, classPtr,
@@ -380,12 +416,17 @@
     ATOM atom;
     CLASS *classPtr;
 
-    if (!(atom = GlobalAddAtom32W( wc->lpszClassName ))) return 0;
+    if (!(atom = GlobalAddAtom32W( wc->lpszClassName )))
+    {
+        SetLastError(ERROR_CLASS_ALREADY_EXISTS);
+        return FALSE;
+    }
     if (!(classPtr = CLASS_RegisterClass( atom, wc->hInstance, wc->style,
                                           wc->cbClsExtra, wc->cbWndExtra,
                                           (WNDPROC16)wc->lpfnWndProc,
                                           WIN_PROC_32W )))
     {
+        SetLastError(ERROR_CLASS_ALREADY_EXISTS);
         GlobalDeleteAtom( atom );
         return 0;
     }
@@ -446,14 +487,19 @@
     ATOM atom;
     CLASS *classPtr;
 
-    if (!(atom = GlobalAddAtom32A( wc->lpszClassName ))) return 0;
+    if (!(atom = GlobalAddAtom32A( wc->lpszClassName )))
+    {
+        SetLastError(ERROR_CLASS_ALREADY_EXISTS);
+        return FALSE;
+    }
     if (!(classPtr = CLASS_RegisterClass( atom, wc->hInstance, wc->style,
                                           wc->cbClsExtra, wc->cbWndExtra,
                                           (WNDPROC16)wc->lpfnWndProc,
                                           WIN_PROC_32A )))
     {
+        SetLastError(ERROR_CLASS_ALREADY_EXISTS);
         GlobalDeleteAtom( atom );
-        return 0;
+        return FALSE;
     }
 
     TRACE(class, "atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
@@ -478,12 +524,17 @@
     ATOM atom;
     CLASS *classPtr;
 
-    if (!(atom = GlobalAddAtom32W( wc->lpszClassName ))) return 0;
+    if (!(atom = GlobalAddAtom32W( wc->lpszClassName )))
+    {
+        SetLastError(ERROR_CLASS_ALREADY_EXISTS);
+        return 0;
+    }
     if (!(classPtr = CLASS_RegisterClass( atom, wc->hInstance, wc->style,
                                           wc->cbClsExtra, wc->cbWndExtra,
                                           (WNDPROC16)wc->lpfnWndProc,
                                           WIN_PROC_32W )))
     {
+        SetLastError(ERROR_CLASS_ALREADY_EXISTS);
         GlobalDeleteAtom( atom );
         return 0;
     }
@@ -520,34 +571,57 @@
 
 /***********************************************************************
  *           UnregisterClass32A    (USER32.563)
+ *
  */
 BOOL32 WINAPI UnregisterClass32A( LPCSTR className, HINSTANCE32 hInstance )
-{
-    CLASS *classPtr;
+{   CLASS *classPtr;
     ATOM atom;
+    BOOL32 ret;
 
-    if (!(atom = GlobalFindAtom32A( className ))) return FALSE;
+    TRACE(class,"%s %x\n",className, hInstance);
+
+    if (!(atom = GlobalFindAtom32A( className )))
+    {
+        SetLastError(ERROR_CLASS_DOES_NOT_EXIST);
+        return FALSE;
+    }
     if (!(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
-        (classPtr->hInstance != hInstance)) return FALSE;
-    return CLASS_FreeClass( classPtr );
+        (classPtr->hInstance != hInstance))
+    {
+        SetLastError(ERROR_CLASS_DOES_NOT_EXIST);
+        return FALSE;
+    }
+    if (!(ret = CLASS_FreeClass( classPtr )))
+        SetLastError(ERROR_CLASS_HAS_WINDOWS);
+    return ret;
 }
 
-
 /***********************************************************************
  *           UnregisterClass32W    (USER32.564)
  */
 BOOL32 WINAPI UnregisterClass32W( LPCWSTR className, HINSTANCE32 hInstance )
-{
-    CLASS *classPtr;
+{   CLASS *classPtr;
     ATOM atom;
+    BOOL32 ret;
 
-    if (!(atom = GlobalFindAtom32W( className ))) return FALSE;
+    TRACE(class,"%s %x\n",debugstr_w(className), hInstance);
+
+    if (!(atom = GlobalFindAtom32W( className )))
+    {
+        SetLastError(ERROR_CLASS_DOES_NOT_EXIST);
+        return FALSE;
+    }
     if (!(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
-        (classPtr->hInstance != hInstance)) return FALSE;
-    return CLASS_FreeClass( classPtr );
+        (classPtr->hInstance != hInstance))
+    {
+        SetLastError(ERROR_CLASS_DOES_NOT_EXIST);
+        return FALSE;
+    }
+    if (!(ret = CLASS_FreeClass( classPtr )))
+        SetLastError(ERROR_CLASS_HAS_WINDOWS);
+    return ret;
 }
 
-
 /***********************************************************************
  *           GetClassWord16    (USER.129)
  */
@@ -564,6 +638,8 @@
 {
     WND * wndPtr;
     
+    TRACE(class,"%x %x\n",hwnd, offset);
+    
     if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
     if (offset >= 0)
     {
@@ -583,6 +659,7 @@
         case GCW_HMODULE:
             return (WORD)GetClassLong32A( hwnd, offset );
     }
+
     WARN(class, "Invalid offset %d\n", offset);
     return 0;
 }
@@ -596,6 +673,8 @@
     WND *wndPtr;
     LONG ret;
 
+    TRACE(class,"%x %x\n",hwnd, offset);
+
     switch( offset )
     {
     case GCL_WNDPROC:
@@ -617,6 +696,8 @@
 {
     WND * wndPtr;
     
+    TRACE(class,"%x %x\n",hwnd, offset);
+    
     if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
     if (offset >= 0)
     {
@@ -651,6 +732,8 @@
 {
     WND * wndPtr;
 
+    TRACE(class,"%x %x\n",hwnd, offset);
+
     switch(offset)
     {
     case GCL_WNDPROC:
@@ -683,6 +766,8 @@
     WORD retval = 0;
     void *ptr;
     
+    TRACE(class,"%x %x %x\n",hwnd, offset, newval);
+    
     if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
     if (offset >= 0)
     {
@@ -724,6 +809,8 @@
     WND *wndPtr;
     LONG retval;
 
+    TRACE(class,"%x %x %lx\n",hwnd, offset, newval);
+
     switch(offset)
     {
     case GCL_WNDPROC:
@@ -749,6 +836,8 @@
     LONG retval = 0;
     void *ptr;
     
+    TRACE(class,"%x %x %lx\n",hwnd, offset, newval);
+        
     if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
     if (offset >= 0)
     {
@@ -798,6 +887,8 @@
     WND *wndPtr;
     LONG retval;
 
+    TRACE(class,"%x %x %lx\n",hwnd, offset, newval);
+    
     switch(offset)
     {
     case GCL_WNDPROC:
@@ -831,10 +922,14 @@
  *           GetClassName32A      (USER32.217)
  */
 INT32 WINAPI GetClassName32A( HWND32 hwnd, LPSTR buffer, INT32 count )
-{
+{   INT32 ret;
     WND *wndPtr;
+            
     if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
-    return GlobalGetAtomName32A( wndPtr->class->atomName, buffer, count );
+    ret = GlobalGetAtomName32A( wndPtr->class->atomName, buffer, count );
+
+    TRACE(class,"%x %s %x\n",hwnd, buffer, count);
+    return ret;
 }
 
 
@@ -842,10 +937,15 @@
  *           GetClassName32W      (USER32.218)
  */
 INT32 WINAPI GetClassName32W( HWND32 hwnd, LPWSTR buffer, INT32 count )
-{
+{   INT32 ret;
     WND *wndPtr;
+
     if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
-    return GlobalGetAtomName32W( wndPtr->class->atomName, buffer, count );
+    ret = GlobalGetAtomName32W( wndPtr->class->atomName, buffer, count );
+
+    TRACE(class,"%x %s %x\n",hwnd, debugstr_w(buffer), count);
+    
+    return ret;
 }
 
 
@@ -858,6 +958,8 @@
     ATOM atom;
     CLASS *classPtr;
 
+    TRACE(class,"%x %p %p\n",hInstance, PTR_SEG_TO_LIN (name), wc);
+    
     hInstance = GetExePtr( hInstance );
     if (!(atom = GlobalFindAtom16( name )) ||
         !(classPtr = CLASS_FindClassByAtom( atom, hInstance )))
@@ -890,11 +992,23 @@
     ATOM atom;
     CLASS *classPtr;
 
-    if (!(atom = GlobalFindAtom32A( name )) ||
-        !(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
-	(classPtr->hInstance && (hInstance != classPtr->hInstance)))
+    TRACE(class,"%x %p %p\n",hInstance, name, wc);
+
+    /* workaround: if hInstance=NULL you expect to get the system classes
+    but this classes (as example from comctl32.dll SysListView) won't be
+    registred with hInstance=NULL in WINE because of the late loading
+    of this dll. fixes file dialogs in WinWord95 (jsch)*/
+
+    if (!(atom=GlobalFindAtom32A(name)) || !(classPtr=CLASS_FindClassByAtom(atom,hInstance)))
         return FALSE;
 
+    if  (classPtr->hInstance && (hInstance != classPtr->hInstance))
+    {
+        if (hInstance) return FALSE;
+        else    
+            WARN(class,"systemclass %s (hInst=0) demanded but only class with hInst!=0 found\n",name);
+    }
+
     wc->style         = classPtr->style;
     wc->lpfnWndProc   = (WNDPROC32)WINPROC_GetProc( classPtr->winproc,
                                                     WIN_PROC_32A );
@@ -919,6 +1033,8 @@
     ATOM atom;
     CLASS *classPtr;
 
+    TRACE(class,"%x %p %p\n",hInstance, name, wc);
+
     if (!(atom = GlobalFindAtom32W( name )) ||
         !(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
 	(classPtr->hInstance && (hInstance != classPtr->hInstance)))
@@ -951,6 +1067,8 @@
     ATOM atom;
     CLASS *classPtr;
 
+    TRACE(class,"%x %p %p\n",hInstance,PTR_SEG_TO_LIN( name ), wc);
+    
     hInstance = GetExePtr( hInstance );
     if (!(atom = GlobalFindAtom16( name )) ||
         !(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
@@ -981,6 +1099,8 @@
     ATOM atom;
     CLASS *classPtr;
 
+    TRACE(class,"%x %p %p\n",hInstance, name, wc);
+    
     if (!(atom = GlobalFindAtom32A( name )) ||
         !(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
         (hInstance != classPtr->hInstance)) return FALSE;
@@ -1009,6 +1129,8 @@
     ATOM atom;
     CLASS *classPtr;
 
+    TRACE(class,"%x %p %p\n",hInstance, name, wc);
+    
     if (!(atom = GlobalFindAtom32W( name )) ||
         !(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
         (hInstance != classPtr->hInstance)) return FALSE;
@@ -1033,6 +1155,7 @@
  */
 BOOL16 WINAPI ClassFirst( CLASSENTRY *pClassEntry )
 {
+    TRACE(class,"%p\n",pClassEntry);
     pClassEntry->wNext = 1;
     return ClassNext( pClassEntry );
 }
@@ -1046,6 +1169,8 @@
     int i;
     CLASS *class = firstClass;
 
+    TRACE(class,"%p\n",pClassEntry);
+   
     if (!pClassEntry->wNext) return FALSE;
     for (i = 1; (i < pClassEntry->wNext) && class; i++) class = class->next;
     if (!class)