Index: trunk/src/user32/USER32.DEF
===================================================================
--- trunk/src/user32/USER32.DEF	(revision 4865)
+++ trunk/src/user32/USER32.DEF	(revision 4866)
@@ -1,3 +1,3 @@
-; $Id: USER32.DEF,v 1.47 2000-12-30 13:27:55 sandervl Exp $
+; $Id: USER32.DEF,v 1.48 2001-01-02 18:14:59 sandervl Exp $
 
 LIBRARY USER32 INITINSTANCE TERMINSTANCE
@@ -637,35 +637,35 @@
 ; Wine/Odin helper function
 ;------------------------------------------------------------------------------
-    GetSysColorPen              = _GetSysColorPen@4              @2002
-    GetPattern55AABrush         = _GetPattern55AABrush@0         @2003
-    GetPattern55AABitmap        = _GetPattern55AABitmap@0        @2004
-
-    _Win32ToOS2Handle@4                                          @2006
-    _OS2ToWin32Handle@4                                          @2012
-
-    _MOUSE_Enable@4                                              @2007
-    _KeyTranslatePMToWin@4                                       @2008
-    _KeyTranslatePMToWinBuf@12                                   @2009
-
-    _wvsnprintfA@16                                              @2010
-
-    _KEYBOARD_Enable@4                                           @2011
+    GetSysColorPen              = _GetSysColorPen@4              @2002 NONAME
+    GetPattern55AABrush         = _GetPattern55AABrush@0         @2003 NONAME
+    GetPattern55AABitmap        = _GetPattern55AABitmap@0        @2004 NONAME
+
+    _Win32ToOS2Handle@4                                          @2006 NONAME
+    _OS2ToWin32Handle@4                                          @2012 NONAME
+
+    _MOUSE_Enable@4                                              @2007 NONAME
+    _KeyTranslatePMToWin@4                                       @2008 NONAME
+    _KeyTranslatePMToWinBuf@12                                   @2009 NONAME
+
+    _wvsnprintfA@16                                              @2010 NONAME
+
+    _KEYBOARD_Enable@4                                           @2011 NONAME
 
     ;SvL: Used by GDI32
-    OSLibGetScreenHeight__Fv                                     @2013
-    OSLibGetScreenWidth__Fv                                      @2014
-
-    _wvsnprintfW@16                                              @2015
-
-    _setPageXForm@4                                              @2016
-    _clientHeight@8                                              @2017
-    _changePageXForm@20                                          @2018
-    _removeClientArea@4                                          @2019
-    _setMapMode@8                                                @2020
-    _TestWideLine@4                                              @2021
-    _Calculate1PixelDelta@4                                      @2022
-    _DIB_GetDIBWidthBytes@8                                      @2023
-    _BITMAP_GetWidthBytes@8                                      @2024
-    _selectClientArea@4                                          @2025
-    _IsSystemBrush@4                                             @2026
-    _IsSystemPen@4                                               @2027
+    OSLibGetScreenHeight__Fv                                     @2013 NONAME
+    OSLibGetScreenWidth__Fv                                      @2014 NONAME
+
+    _wvsnprintfW@16                                              @2015 NONAME
+
+    _setPageXForm@4                                              @2016 NONAME
+    _clientHeight@8                                              @2017 NONAME
+    _changePageXForm@20                                          @2018 NONAME
+    _removeClientArea@4                                          @2019 NONAME
+    _setMapMode@8                                                @2020 NONAME
+    _TestWideLine@4                                              @2021 NONAME
+    _Calculate1PixelDelta@4                                      @2022 NONAME
+    _DIB_GetDIBWidthBytes@8                                      @2023 NONAME
+    _BITMAP_GetWidthBytes@8                                      @2024 NONAME
+    _selectClientArea@4                                          @2025 NONAME
+    _IsSystemBrush@4                                             @2026 NONAME
+    _IsSystemPen@4                                               @2027 NONAME
Index: trunk/src/user32/win32wndhandle.cpp
===================================================================
--- trunk/src/user32/win32wndhandle.cpp	(revision 4865)
+++ trunk/src/user32/win32wndhandle.cpp	(revision 4866)
@@ -1,3 +1,3 @@
-/* $Id: win32wndhandle.cpp,v 1.7 2000-03-23 19:24:26 sandervl Exp $ */
+/* $Id: win32wndhandle.cpp,v 1.8 2001-01-02 18:14:59 sandervl Exp $ */
 /*
  * Win32 Handle Management Code for OS/2
@@ -34,5 +34,5 @@
 ULONG  WindowHandleTable[MAX_WINDOW_HANDLES] = {0};
 VMutex tableMutex(VMUTEX_SHARED, &hGlobalTableMutex);
-ULONG  lowestFreeIndex = 0;
+ULONG  lastIndex = 0;
 #pragma data_seg()
 
@@ -42,24 +42,26 @@
 {
   tableMutex.enter(VMUTEX_WAIT_FOREVER, &hGlobalTableMutex);
-  if(lowestFreeIndex == -1) {
+
+  //find next free handle
+  if(lastIndex >= MAX_WINDOW_HANDLES-1) {
+        lastIndex = 0;
+  }
+  for(int i=lastIndex;i<MAX_WINDOW_HANDLES;i++) {
+	if(WindowHandleTable[i] == 0) {
+		lastIndex = i;
+		break;
+	}
+  }
+  if(i == MAX_WINDOW_HANDLES) {
 	//oops, out of handles
-	dprintf(("USER32: HwAllocateWindowHandle OUT OF WINDOW HANDLES!!"));
 	tableMutex.leave(&hGlobalTableMutex);
+	dprintf(("ERROR: USER32: HwAllocateWindowHandle OUT OF WINDOW HANDLES!!"));
 	DebugInt3();
 	return FALSE;
   }
-  *hwnd           = lowestFreeIndex;
-  *hwnd          |= WNDHANDLE_MAGIC_HIGHWORD;
-  WindowHandleTable[lowestFreeIndex] = dwUserData;
+  *hwnd  = lastIndex;
+  *hwnd |= WNDHANDLE_MAGIC_HIGHWORD;
+  WindowHandleTable[lastIndex] = dwUserData;
 
-  lowestFreeIndex = -1;
-
-  //find next free handle
-  for(int i=0;i<MAX_WINDOW_HANDLES;i++) {
-	if(WindowHandleTable[i] == 0) {
-		lowestFreeIndex = i;
-		break;
-	}
-  }
   tableMutex.leave(&hGlobalTableMutex);
   return TRUE;
@@ -73,7 +75,4 @@
 	tableMutex.enter(VMUTEX_WAIT_FOREVER, &hGlobalTableMutex);
 	WindowHandleTable[hwnd] = 0;
-	if(lowestFreeIndex == -1 || hwnd < lowestFreeIndex) 
-		lowestFreeIndex = hwnd;
-
 	tableMutex.leave(&hGlobalTableMutex);
   }
Index: trunk/src/user32/windowclass.cpp
===================================================================
--- trunk/src/user32/windowclass.cpp	(revision 4865)
+++ trunk/src/user32/windowclass.cpp	(revision 4866)
@@ -1,3 +1,3 @@
-/* $Id: windowclass.cpp,v 1.13 2000-10-22 19:53:25 sandervl Exp $ */
+/* $Id: windowclass.cpp,v 1.14 2001-01-02 18:14:59 sandervl Exp $ */
 /*
  * Win32 Window Class Code for OS/2
@@ -400,12 +400,14 @@
 {
  Win32BaseWindow *wnd;
-
-    dprintf(("USER32: GetClassLongA %x %d", hwnd, nIndex));
-    wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
-    if(!wnd) {
-        dprintf(("GetClassLongA wnd == NULL"));
-        return(0);
-    }
-    return (wnd->getClass())->getClassLongA(nIndex);
+ LONG ret;
+
+    wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
+    if(!wnd) {
+        dprintf(("GetClassLongA %x %d wnd == NULL", hwnd, nIndex));
+        return(0);
+    }
+    ret = (wnd->getClass())->getClassLongA(nIndex);
+    dprintf(("USER32: GetClassLongA %x %d returned %x", hwnd, nIndex, ret));
+    return ret;
 }
 //******************************************************************************
@@ -414,13 +416,15 @@
 {
  Win32BaseWindow *wnd;
-
-    dprintf(("USER32: GetClassLongW\n"));
-    wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
-    if(!wnd) {
-        dprintf(("GetClassLongW wnd == NULL"));
-        return(0);
-    }
-    return (wnd->getClass())->getClassLongW(nIndex);
-}
-//******************************************************************************
-//******************************************************************************
+ LONG ret;
+
+    wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
+    if(!wnd) {
+        dprintf(("GetClassLongW %x %d wnd == NULL", hwnd, nIndex));
+        return(0);
+    }
+    ret = (wnd->getClass())->getClassLongW(nIndex);
+    dprintf(("USER32: GetClassLongW %x %d returned %x", hwnd, nIndex, ret));
+    return ret;
+}
+//******************************************************************************
+//******************************************************************************
