Compile user with -DSTRICT

Johan Dahlin jdahlin at async.com.br
Fri Nov 22 14:49:01 CST 2002


If this is applied with my last patch, the whole tree will now compile
with -DSTRICT.

A few notes:
include/winuser.h: HBMMENU_* defines were changed to normal ints (since
gcc complain with pointer in case clauses, and HBITMAP is now a pointer)
include/wownt32.h: This is a central place for *_32 and *_16 macros, i'm
not sure if this is the right thing to do, maybe it's better to keep a
list of macros in the individual dlls instead.

License: LGPL

ChangeLog
  Make user compilable with -DSTRICT

Index: dlls/user/Makefile.in
===================================================================
RCS file: /home/wine/wine/dlls/user/Makefile.in,v
retrieving revision 1.58
diff -u -u -r1.58 Makefile.in
--- dlls/user/Makefile.in	18 Nov 2002 23:16:09 -0000	1.58
+++ dlls/user/Makefile.in	22 Nov 2002 20:43:31 -0000
@@ -1,4 +1,4 @@
-EXTRADEFS = -D_USER32_ -D_WINABLE_ -DWINE_NO_STRICT
+EXTRADEFS = -D_USER32_ -D_WINABLE_
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
Index: dlls/user/caret.c
===================================================================
RCS file: /home/wine/wine/dlls/user/caret.c,v
retrieving revision 1.2
diff -u -u -r1.2 caret.c
--- dlls/user/caret.c	22 Nov 2002 04:47:10 -0000	1.2
+++ dlls/user/caret.c	22 Nov 2002 20:43:31 -0000
@@ -112,7 +112,7 @@
     HBITMAP hBmp = 0;
     HWND prev = 0;
 
-    TRACE("hwnd=%04x\n", hwnd);
+    TRACE("hwnd=%p\n", hwnd);
 
     if (!hwnd) return FALSE;
 
Index: dlls/user/comm16.c
===================================================================
RCS file: /home/wine/wine/dlls/user/comm16.c,v
retrieving revision 1.13
diff -u -u -r1.13 comm16.c
--- dlls/user/comm16.c	31 May 2002 23:40:53 -0000	1.13
+++ dlls/user/comm16.c	22 Nov 2002 20:43:32 -0000
@@ -317,7 +317,7 @@
 
 	/* send notifications, if any */
 	if (ptr->wnd && mask) {
-		TRACE("notifying %04x: cid=%d, mask=%02x\n", ptr->wnd, cid, mask);
+		TRACE("notifying %p: cid=%d, mask=%02x\n", ptr->wnd, cid, mask);
 		PostMessageA(ptr->wnd, WM_COMMNOTIFY, cid, mask);
 	}
 
@@ -395,7 +395,7 @@
 
 	/* send notifications, if any */
 	if (ptr->wnd && mask) {
-		TRACE("notifying %04x: cid=%d, mask=%02x\n", ptr->wnd, cid, mask);
+		TRACE("notifying %p: cid=%d, mask=%02x\n", ptr->wnd, cid, mask);
 		PostMessageA(ptr->wnd, WM_COMMNOTIFY, cid, mask);
 	}
 
Index: dlls/user/focus.c
===================================================================
RCS file: /home/wine/wine/dlls/user/focus.c,v
retrieving revision 1.3
diff -u -u -r1.3 focus.c
--- dlls/user/focus.c	22 Nov 2002 04:47:10 -0000	1.3
+++ dlls/user/focus.c	22 Nov 2002 20:43:32 -0000
@@ -218,7 +218,7 @@
 {
     HWND prev;
 
-    TRACE( "%x\n", hwnd );
+    TRACE( "%p\n", hwnd );
 
     if (hwnd)
     {
@@ -243,7 +243,7 @@
     HWND hwndTop = hwnd;
     HWND previous = GetFocus();
 
-    TRACE( "%x prev %x\n", hwnd, previous );
+    TRACE( "%p prev %p\n", hwnd, previous );
 
     if (hwnd)
     {
@@ -286,7 +286,7 @@
  */
 BOOL WINAPI SetForegroundWindow( HWND hwnd )
 {
-    TRACE( "%x\n", hwnd );
+    TRACE( "%p\n", hwnd );
     if (hwnd) hwnd = WIN_GetFullHandle( hwnd );
     return set_foreground_window( hwnd, FALSE );
 }
Index: dlls/user/hook.c
===================================================================
RCS file: /home/wine/wine/dlls/user/hook.c,v
retrieving revision 1.2
diff -u -u -r1.2 hook.c
--- dlls/user/hook.c	20 Nov 2002 19:54:32 -0000	1.2
+++ dlls/user/hook.c	22 Nov 2002 20:43:32 -0000
@@ -145,7 +145,7 @@
     }
     SERVER_END_REQ;
 
-    TRACE( "%s %p %lx -> %x\n", hook_names[id-WH_MINHOOK], proc, tid,
handle );
+    TRACE( "%s %p %lx -> %p\n", hook_names[id-WH_MINHOOK], proc, tid,
handle );
     return handle;
 }
 
@@ -380,7 +380,7 @@
 {
     BOOL ret;
 
-    TRACE( "%x\n", hhook );
+    TRACE( "%p\n", hhook );
 
     SERVER_START_REQ( remove_hook )
     {
@@ -481,7 +481,7 @@
                                      WINEVENTPROC pfnProc, DWORD
dwProcess,
                                      DWORD dwThread, DWORD dwFlags)
 {
-    FIXME("(%ld,%ld,0x%08x,%p,%ld,%ld,0x%08lx)-stub!\n", dwMin, dwMax,
hModule,
+    FIXME("(%ld,%ld,%p,%p,%ld,%ld,0x%08lx)-stub!\n", dwMin, dwMax,
hModule,
           pfnProc, dwProcess, dwThread, dwFlags);
     return 0;
 }
@@ -504,7 +504,7 @@
  */
 BOOL WINAPI UnhookWinEvent(HWINEVENTHOOK hEventHook)
 {
-    FIXME("(%x)-stub!\n", hEventHook);
+    FIXME("(%p)-stub!\n", hEventHook);
 
     return (hEventHook != 0);
 }
@@ -529,7 +529,7 @@
  */
 void WINAPI NotifyWinEvent(DWORD dwEvent, HWND hWnd, LONG nId, LONG
nChildId)
 {
-    FIXME("(%ld,0x%08x,%ld,%ld)-stub!\n", dwEvent, hWnd, nId,
nChildId);
+    FIXME("(%ld,%p,%ld,%ld)-stub!\n", dwEvent, hWnd, nId, nChildId);
 }
 
 
Index: dlls/user/message.c
===================================================================
RCS file: /home/wine/wine/dlls/user/message.c,v
retrieving revision 1.28
diff -u -u -r1.28 message.c
--- dlls/user/message.c	21 Nov 2002 23:44:58 -0000	1.28
+++ dlls/user/message.c	22 Nov 2002 20:43:33 -0000
@@ -36,6 +36,7 @@
 #include "user.h"
 #include "win.h"
 #include "wine/debug.h"
+#include "wownt32.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msg);
 
@@ -1173,7 +1174,7 @@
         if (HIWORD(uiHi))
         {
             /* uiHi should contain a hMem from WM_DDE_EXECUTE */
-            HGLOBAL h = dde_get_pair( uiHi );
+            HGLOBAL h = dde_get_pair( HGLOBAL_32( uiHi ));
             if (h)
             {
                 /* send back the value of h on the other side */
@@ -1279,8 +1280,8 @@
             if (!buffer || !*buffer) return FALSE;
             uiLo = *lparam;
             memcpy( &hMem, *buffer, size );
-            uiHi = hMem;
-            TRACE("recv dde-ack %u mem=%x[%lx]\n", uiLo, uiHi,
GlobalSize( uiHi ));
+            uiHi = HGLOBAL_16( hMem );
+            TRACE("recv dde-ack %u mem=%x[%lx]\n", uiLo, uiHi,
GlobalSize( HGLOBAL_32( uiHi )));
         }
         else
         {
@@ -1306,7 +1307,7 @@
             }
             else return FALSE;
         }
-	uiLo = hMem;
+	uiLo = HGLOBAL_16( hMem );
 
 	*lparam = PackDDElParam( message, uiLo, uiHi );
 	break;
@@ -1320,14 +1321,14 @@
 		memcpy( ptr, *buffer, size );
 		GlobalUnlock( hMem );
                 TRACE( "exec: pairing c=%08lx s=%08lx\n", *lparam,
(DWORD)hMem );
-                if (!dde_add_pair( *lparam, hMem ))
+                if (!dde_add_pair( HGLOBAL_32( *lparam ), hMem ))
                 {
                     GlobalFree( hMem );
                     return FALSE;
                 }
 	    }
 	} else return FALSE;
-	*lparam = hMem;
+	*lparam = HGLOBAL_16( hMem );
         break;
     }
     return TRUE;
@@ -1445,7 +1446,7 @@
 
         if (res) return FALSE;
 
-        TRACE( "got type %d msg %x hwnd %x wp %x lp %lx\n",
+        TRACE( "got type %d msg %x hwnd %p wp %x lp %lx\n",
                info.type, info.msg.message, info.msg.hwnd,
info.msg.wParam, info.msg.lParam );
 
         switch(info.type)
@@ -1465,7 +1466,7 @@
             if (!unpack_message( info.msg.hwnd, info.msg.message,
&info.msg.wParam,
                                  &info.msg.lParam, &buffer, size ))
             {
-                ERR( "invalid packed message %x (%s) hwnd %x wp %x lp
%lx size %d\n",
+                ERR( "invalid packed message %x (%s) hwnd %p wp %x lp
%lx size %d\n",
                      info.msg.message, SPY_GetMsgName(info.msg.message,
info.msg.hwnd), info.msg.hwnd,
                      info.msg.wParam, info.msg.lParam, size );
                 /* ignore it */
@@ -1494,7 +1495,7 @@
 		if (!unpack_dde_message( info.msg.hwnd, info.msg.message,
&info.msg.wParam,
                                          &info.msg.lParam, &buffer,
size ))
 		{
-		    ERR( "invalid packed dde-message %x (%s) hwnd %x wp %x lp %lx
size %d\n",
+		    ERR( "invalid packed dde-message %x (%s) hwnd %p wp %x lp %lx
size %d\n",
 			 info.msg.message, SPY_GetMsgName(info.msg.message, info.msg.hwnd),
 			 info.msg.hwnd, info.msg.wParam, info.msg.lParam, size );
 		    /* ignore it */
@@ -1662,7 +1663,7 @@
 
     if (reply_data) HeapFree( GetProcessHeap(), 0, reply_data );
 
-    TRACE( "hwnd %x msg %x (%s) wp %x lp %lx got reply %lx
(err=%ld)\n",
+    TRACE( "hwnd %p msg %x (%s) wp %x lp %lx got reply %lx
(err=%ld)\n",
            info->hwnd, info->msg, SPY_GetMsgName(info->msg,
info->hwnd), info->wparam,
            info->lparam, *result, status );
 
@@ -1683,7 +1684,7 @@
     int locks;
     size_t reply_size = 0;
 
-    TRACE( "hwnd %x msg %x (%s) wp %x lp %lx\n",
+    TRACE( "hwnd %p msg %x (%s) wp %x lp %lx\n",
            info->hwnd, info->msg, SPY_GetMsgName(info->msg,
info->hwnd), info->wparam, info->lparam );
 
     if (!put_message_in_queue( dest_tid, info, &reply_size )) return 0;
Index: dlls/user/misc.c
===================================================================
RCS file: /home/wine/wine/dlls/user/misc.c,v
retrieving revision 1.9
diff -u -u -r1.9 misc.c
--- dlls/user/misc.c	28 Jul 2002 23:48:27 -0000	1.9
+++ dlls/user/misc.c	22 Nov 2002 20:43:33 -0000
@@ -178,7 +178,7 @@
 BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex,
 				       LPVOID pvInfo, DWORD nLength )
 {
-    FIXME("(%x,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength);
+    FIXME("(%p,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength);
     return TRUE;
 }
 
@@ -187,7 +187,7 @@
  */
 BOOL WINAPI SetThreadDesktop( HANDLE hDesktop )
 {
-    FIXME("(%x): stub\n",hDesktop);
+    FIXME("(%p): stub\n",hDesktop);
     return TRUE;
 }
 
Index: dlls/user/msg16.c
===================================================================
RCS file: /home/wine/wine/dlls/user/msg16.c,v
retrieving revision 1.17
diff -u -u -r1.17 msg16.c
--- dlls/user/msg16.c	29 Oct 2002 00:41:43 -0000	1.17
+++ dlls/user/msg16.c	22 Nov 2002 20:43:33 -0000
@@ -207,7 +207,7 @@
                                   &msg16->msg.message,
&msg16->msg.wParam,
                                   &msg16->msg.lParam ) == -1);
 
-    TRACE( "message %04x, hwnd %04x, filter(%04x - %04x)\n",
+    TRACE( "message %04x, hwnd %p, filter(%04x - %04x)\n",
            msg16->msg.message, hwnd, first, last );
 
     return msg16->msg.message != WM_QUIT;
@@ -282,7 +282,7 @@
     if (wndPtr == WND_OTHER_PROCESS)
     {
         if (IsWindow( hwnd ))
-            ERR( "cannot dispatch msg to other process window %x\n",
hwnd );
+            ERR( "cannot dispatch msg to other process window %p\n",
hwnd );
         SetLastError( ERROR_INVALID_WINDOW_HANDLE );
         return 0;
     }
@@ -307,7 +307,7 @@
         WIN_ReleasePtr( wndPtr );
         if (validate)
         {
-            ERR( "BeginPaint not called on WM_PAINT for hwnd %x!\n",
hwnd );
+            ERR( "BeginPaint not called on WM_PAINT for hwnd %p!\n",
hwnd );
             /* Validate the update region to avoid infinite WM_PAINT
loop */
             RedrawWindow( hwnd, NULL, 0,
                           RDW_NOFRAME | RDW_VALIDATE | RDW_NOCHILDREN |
RDW_NOINTERNALPAINT );
Index: dlls/user/painting.c
===================================================================
RCS file: /home/wine/wine/dlls/user/painting.c,v
retrieving revision 1.3
diff -u -u -r1.3 painting.c
--- dlls/user/painting.c	22 Nov 2002 04:47:10 -0000	1.3
+++ dlls/user/painting.c	22 Nov 2002 20:43:34 -0000
@@ -118,7 +118,7 @@
 
     if (!wnd || wnd == WND_OTHER_PROCESS) return 0;
 
-    TRACE("hwnd %04x [%04x] ncf %i\n",
+    TRACE("hwnd %p [%p] ncf %i\n",
           hwnd, wnd->hrgnUpdate, wnd->flags & WIN_NEEDS_NCPAINT);
 
     get_update_regions( wnd, &whole_rgn, &client_rgn );
@@ -162,7 +162,7 @@
     if (!(full_handle = WIN_IsCurrentThread( hwnd )))
     {
         if (IsWindow(hwnd))
-            FIXME( "window %x belongs to other thread\n", hwnd );
+            FIXME( "window %p belongs to other thread\n", hwnd );
         return 0;
     }
     hwnd = full_handle;
@@ -202,7 +202,7 @@
 
     if (!lps->hdc)
     {
-        WARN("GetDCEx() failed in BeginPaint(), hwnd=%04x\n", hwnd);
+        WARN("GetDCEx() failed in BeginPaint(), hwnd=%p\n", hwnd);
         DeleteObject( hrgnUpdate );
         return 0;
     }
@@ -219,7 +219,7 @@
     IntersectRect(&lps->rcPaint, &clientRect, &clipRect);
     DPtoLP(lps->hdc, (LPPOINT)&lps->rcPaint, 2);  /* we must return LP
*/
 
-    TRACE("hdc = %x box = (%i,%i - %i,%i)\n",
+    TRACE("hdc = %p box = (%i,%i - %i,%i)\n",
           lps->hdc, lps->rcPaint.left, lps->rcPaint.top,
lps->rcPaint.right, lps->rcPaint.bottom );
 
     if (!(wndPtr = WIN_GetPtr( hwnd )) || wndPtr == WND_OTHER_PROCESS)
return 0;
Index: dlls/user/resource.c
===================================================================
RCS file: /home/wine/wine/dlls/user/resource.c,v
retrieving revision 1.14
diff -u -u -r1.14 resource.c
--- dlls/user/resource.c	17 Oct 2002 16:43:43 -0000	1.14
+++ dlls/user/resource.c	22 Nov 2002 20:43:34 -0000
@@ -105,7 +105,7 @@
 	accel16[i-1].fVirt |= 0x80;
       }
     }
-    TRACE_(accel)("returning HACCEL 0x%x\n", hRsrc);
+    TRACE_(accel)("returning HACCEL %p\n", hRsrc);
     return HACCEL_32(hRetval);
 }
 
@@ -218,7 +218,7 @@
   /* Allocate memory and copy the table. */
   hAccel = HACCEL_32(GlobalAlloc16(0,cEntries*sizeof(ACCEL16)));
 
-  TRACE_(accel)("handle %x\n", hAccel);
+  TRACE_(accel)("handle %p\n", hAccel);
   if(!hAccel) {
     ERR_(accel)("Out of memory.\n");
     SetLastError(ERROR_NOT_ENOUGH_MEMORY);
@@ -233,7 +233,7 @@
   /* Set the end-of-table terminator. */
   accel[cEntries-1].fVirt |= 0x80;
 
-  TRACE_(accel)("Allocated accelerator handle %x\n", hAccel);
+  TRACE_(accel)("Allocated accelerator handle %p\n", hAccel);
   return hAccel;
 }
 
@@ -264,7 +264,7 @@
   /* Allocate memory and copy the table. */
   hAccel = HACCEL_32(GlobalAlloc16(0,cEntries*sizeof(ACCEL16)));
 
-  TRACE_(accel)("handle %x\n", hAccel);
+  TRACE_(accel)("handle %p\n", hAccel);
   if(!hAccel) {
     ERR_(accel)("Out of memory.\n");
     SetLastError(ERROR_NOT_ENOUGH_MEMORY);
@@ -288,7 +288,7 @@
   /* Set the end-of-table terminator. */
   accel[cEntries-1].fVirt |= 0x80;
 
-  TRACE_(accel)("Allocated accelerator handle %x\n", hAccel);
+  TRACE_(accel)("Allocated accelerator handle %p\n", hAccel);
   return hAccel;
 }
 
@@ -368,7 +368,7 @@
 
     if (HIWORD(resource_id)==0xFFFF) /* netscape 3 passes this */
 	resource_id = (UINT)(-((INT)resource_id));
-    TRACE("instance = %04x, id = %04x, buffer = %08x, length = %d\n",
+    TRACE("instance = %p, id = %04x, buffer = %08x, length = %d\n",
           instance, (int)resource_id, (int) buffer, buflen);
 
     /* Use bits 4 - 19 (incremented by 1) as resourceid, mask out
@@ -414,7 +414,7 @@
     INT    retval;
     LPWSTR wbuf;
 
-    TRACE("instance = %04x, id = %04x, buffer = %08x, length = %d\n",
+    TRACE("instance = %p, id = %04x, buffer = %08x, length = %d\n",
           instance, (int)resource_id, (int) buffer, buflen);
 
     if(buffer == NULL) /* asked size of string */
Index: dlls/user/text.c
===================================================================
RCS file: /home/wine/wine/dlls/user/text.c,v
retrieving revision 1.40
diff -u -u -r1.40 text.c
--- dlls/user/text.c	22 Nov 2002 04:47:10 -0000	1.40
+++ dlls/user/text.c	22 Nov 2002 20:43:35 -0000
@@ -1210,11 +1210,14 @@
 {
     struct gray_string_info info;
 
-    if (!gsprc) return TEXT_GrayString(hdc, hbr, NULL, lParam, cch, x,
y, cx, cy, FALSE, FALSE);
+    if (!gsprc) {
+	    return TEXT_GrayString( HDC_32( hdc ), HBRUSH_32( hbr ), NULL,
+				   lParam, cch, x, y, cx, cy, FALSE, FALSE);
+    }
     info.proc  = gsprc;
     info.param = lParam;
-    return TEXT_GrayString( hdc, hbr, gray_string_callback,
(LPARAM)&info,
-                            cch, x, y, cx, cy, FALSE, FALSE);
+    return TEXT_GrayString( HDC_32( hdc ), HBRUSH_32( hbr ),
gray_string_callback,
+			    (LPARAM)&info, cch, x, y, cx, cy, FALSE, FALSE);
 }
 
 
@@ -1334,7 +1337,7 @@
                              const INT16 *lpTabPos, INT16 nTabOrg )
 {
     TRACE("%04x %d,%d %s %d\n", hdc, x, y, debugstr_an(lpstr,count),
count );
-    return TEXT_TabbedTextOut( hdc, x, y, lpstr, count, cTabStops,
+    return TEXT_TabbedTextOut( HDC_32( hdc ), x, y, lpstr, count,
cTabStops,
                                lpTabPos, NULL, nTabOrg, TRUE );
 }
 
@@ -1345,8 +1348,8 @@
 LONG WINAPI TabbedTextOutA( HDC hdc, INT x, INT y, LPCSTR lpstr, INT
count,
                             INT cTabStops, const INT *lpTabPos, INT
nTabOrg )
 {
-    TRACE("%04x %d,%d %s %d\n", hdc, x, y, debugstr_an(lpstr,count),
count );
-    return TEXT_TabbedTextOut( hdc, x, y, lpstr, count, cTabStops,
+    TRACE("%p %d,%d %s %d\n", hdc, x, y, debugstr_an(lpstr,count),
count );
+    return TEXT_TabbedTextOut( hdc , x, y, lpstr, count, cTabStops,
                                NULL, lpTabPos, nTabOrg, TRUE );
 }
 
@@ -1379,7 +1382,7 @@
                                     INT16 cTabStops, const INT16
*lpTabPos )
 {
     TRACE("%04x %s %d\n", hdc, debugstr_an(lpstr,count), count );
-    return TEXT_TabbedTextOut( hdc, 0, 0, lpstr, count, cTabStops,
+    return TEXT_TabbedTextOut( HDC_32( hdc ), 0, 0, lpstr, count,
cTabStops,
                                lpTabPos, NULL, 0, FALSE );
 }
 
@@ -1390,7 +1393,7 @@
 DWORD WINAPI GetTabbedTextExtentA( HDC hdc, LPCSTR lpstr, INT count,
                                    INT cTabStops, const INT *lpTabPos )
 {
-    TRACE("%04x %s %d\n", hdc, debugstr_an(lpstr,count), count );
+    TRACE("%p %s %d\n", hdc, debugstr_an(lpstr,count), count );
     return TEXT_TabbedTextOut( hdc, 0, 0, lpstr, count, cTabStops,
                                NULL, lpTabPos, 0, FALSE );
 }
Index: dlls/user/user16.c
===================================================================
RCS file: /home/wine/wine/dlls/user/user16.c,v
retrieving revision 1.9
diff -u -u -r1.9 user16.c
--- dlls/user/user16.c	22 Nov 2002 04:47:10 -0000	1.9
+++ dlls/user/user16.c	22 Nov 2002 20:43:35 -0000
@@ -25,13 +25,6 @@
 #include "user.h"
 #include "win.h"
 
-/* handle to handle 16 conversions */
-#define HANDLE_16(h32)		(LOWORD(h32))
-
-/* handle16 to handle conversions */
-#define HANDLE_32(h16)		((HANDLE)(ULONG_PTR)(h16))
-#define HINSTANCE_32(h16)	((HINSTANCE)(ULONG_PTR)(h16))
-
 #define IS_MENU_STRING_ITEM(flags) \
     (((flags) & (MF_STRING | MF_BITMAP | MF_OWNERDRAW | MF_SEPARATOR))
== MF_STRING)
 
@@ -76,8 +69,9 @@
         CONV_RECT16TO32( rect, &rect32 );
         ret = DrawTextA( HDC_32(hdc), str, count, &rect32, flags );
         CONV_RECT32TO16( &rect32, rect );
+    } else {
+	    ret = DrawTextA( HDC_32(hdc), str, count, NULL, flags);
     }
-    else ret = DrawTextA( hdc, str, count, NULL, flags);
     return ret;
 }
 
@@ -444,7 +438,7 @@
  */
 BOOL16 WINAPI AppendMenu16(HMENU16 hMenu, UINT16 flags, UINT16 id,
SEGPTR data)
 {
-    return InsertMenu16( HMENU_32(hMenu), -1, flags | MF_BYPOSITION,
id, data );
+    return InsertMenu16( hMenu, -1, flags | MF_BYPOSITION, id, data );
 }
 
 
@@ -514,9 +508,9 @@
     miia.fType         = mii->fType;
     miia.fState        = mii->fState;
     miia.wID           = mii->wID;
-    miia.hSubMenu      = mii->hSubMenu;
-    miia.hbmpChecked   = mii->hbmpChecked;
-    miia.hbmpUnchecked = mii->hbmpUnchecked;
+    miia.hSubMenu      = HMENU_32(mii->hSubMenu);
+    miia.hbmpChecked   = HBITMAP_32(mii->hbmpChecked);
+    miia.hbmpUnchecked = HBITMAP_32(mii->hbmpUnchecked);
     miia.dwItemData    = mii->dwItemData;
     miia.cch           = mii->cch;
     if (IS_MENU_STRING_ITEM(miia.fType))
Index: dlls/user/user_main.c
===================================================================
RCS file: /home/wine/wine/dlls/user/user_main.c,v
retrieving revision 1.49
diff -u -u -r1.49 user_main.c
--- dlls/user/user_main.c	14 Nov 2002 22:30:20 -0000	1.49
+++ dlls/user/user_main.c	22 Nov 2002 20:43:35 -0000
@@ -38,6 +38,7 @@
 #include "user.h"
 #include "win.h"
 #include "wine/debug.h"
+#include "wownt32.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(graphics);
 
@@ -305,7 +306,7 @@
             /* ModuleUnload() in "Internals" */
             /* HOOK_FreeModuleHooks( hModule ); */
             CLASS_FreeModuleClasses( hModule );
-            CURSORICON_FreeModuleIcons( hModule );
+            CURSORICON_FreeModuleIcons( HMODULE_32( hModule ));
         }
     }
     exiting_thread_id = 0;
Index: dlls/user/wnd16.c
===================================================================
RCS file: /home/wine/wine/dlls/user/wnd16.c,v
retrieving revision 1.16
diff -u -u -r1.16 wnd16.c
--- dlls/user/wnd16.c	28 Oct 2002 20:11:40 -0000	1.16
+++ dlls/user/wnd16.c	22 Nov 2002 20:43:36 -0000
@@ -24,10 +24,6 @@
 #include "win.h"
 #include "stackframe.h"
 
-/* handle <--> handle16 conversions */
-#define HANDLE_16(h32)		(LOWORD(h32))
-#define HANDLE_32(h16)		((HANDLE)(ULONG_PTR)(h16))
-
 static HWND16 hwndSysModal;
 
 /* ### start build ### */
Index: dlls/user/dde/client.c
===================================================================
RCS file: /home/wine/wine/dlls/user/dde/client.c,v
retrieving revision 1.10
diff -u -u -r1.10 client.c
--- dlls/user/dde/client.c	19 Oct 2002 00:52:55 -0000	1.10
+++ dlls/user/dde/client.c	22 Nov 2002 20:43:36 -0000
@@ -39,6 +39,9 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(ddeml);
 
+#define HGLOBAL_32(h16) ((HGLOBAL)(ULONG_PTR)(h16))
+#define HGLOBAL_16(h32) (LOWORD(h32))
+
 static LRESULT CALLBACK WDML_ClientProc(HWND, UINT, WPARAM, LPARAM);	/*
only for one client, not conv list */
 const char  WDML_szClientConvClassA[] = "DdeClientAnsi";
 const WCHAR WDML_szClientConvClassW[] =
{'D','d','e','C','l','i','e','n','t','U','n','i','c','o','d','e',0};
@@ -60,7 +63,7 @@
 HCONVLIST WINAPI DdeConnectList(DWORD idInst, HSZ hszService, HSZ
hszTopic,
 				HCONVLIST hConvList, LPCONVCONTEXT pCC)
 {
-    FIXME("(%ld,%d,%d,%d,%p): stub\n", idInst, hszService, hszTopic,
hConvList, pCC);
+    FIXME("(%ld,%p,%p,%p,%p): stub\n", idInst, hszService, hszTopic,
hConvList, pCC);
     return (HCONVLIST)1;
 }
 
@@ -69,7 +72,7 @@
  */
 HCONV WINAPI DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev)
 {
-    FIXME("(%d,%d): stub\n", hConvList, hConvPrev);
+    FIXME("(%p,%p): stub\n", hConvList, hConvPrev);
     return 0;
 }
 
@@ -86,7 +89,7 @@
  */
 BOOL WINAPI DdeDisconnectList(HCONVLIST hConvList)
 {
-    FIXME("(%d): stub\n", hConvList);
+    FIXME("(%p): stub\n", hConvList);
     return TRUE;
 }
 
@@ -101,7 +104,7 @@
     WDML_CONV*		pConv = NULL;
     ATOM		aSrv = 0, aTpc = 0;
 
-    TRACE("(0x%lx,0x%x,0x%x,%p)\n", idInst, hszService, hszTopic, pCC);
+    TRACE("(0x%lx,%p,%p,%p)\n", idInst, hszService, hszTopic, pCC);
 
     EnterCriticalSection(&WDML_CritSect);
 
@@ -201,7 +204,7 @@
 	pConv = NULL;
 	goto theEnd;
     }
-    TRACE("Connected to Server window (%x)\n", pConv->hwndServer);
+    TRACE("Connected to Server window (%p)\n", pConv->hwndServer);
     pConv->wConvst = XST_CONNECTED;
 
     /* finish init of pConv */
@@ -633,7 +636,7 @@
  *
  *
  */
-static WDML_XACT*	WDML_ClientQueueExecute(WDML_CONV* pConv, LPCVOID
pData, DWORD cbData)
+static WDML_XACT* WDML_ClientQueueExecute(WDML_CONV* pConv, LPCVOID
pData, DWORD cbData)
 {
     WDML_XACT*	pXAct;
 
@@ -659,7 +662,7 @@
 	pXAct->hMem = WDML_BuildExecuteCommand(pConv, pData, cbData);
     }
 
-    pXAct->lParam = pXAct->hMem;
+    pXAct->lParam = HGLOBAL_16(pXAct->hMem);
 
     return pXAct;
 }
@@ -682,7 +685,7 @@
     UnpackDDElParam(WM_DDE_ACK, msg->lParam, &uiLo, &uiHi);
     FreeDDElParam(WM_DDE_ACK, msg->lParam);
 
-    if (uiHi != pXAct->hMem)
+    if (uiHi != HGLOBAL_16(pXAct->hMem))
     {
         return WDML_QS_PASS;
     }
@@ -735,7 +738,7 @@
 	}
     }
 
-    pXAct->lParam = PackDDElParam(WM_DDE_POKE, pXAct->hMem, atom);
+    pXAct->lParam = PackDDElParam(WM_DDE_POKE, HGLOBAL_16(pXAct->hMem),
atom);
 
     return pXAct;
 }
@@ -871,7 +874,7 @@
     {
         if (uiLo)
         {
-            GlobalFree(uiLo);
+            GlobalFree(HGLOBAL_32(uiLo));
         }
     }
 
@@ -1090,7 +1093,7 @@
     WDML_XACT*		pXAct;
     HDDEDATA		hDdeData = 0;
 
-    TRACE("(%p,%ld,0x%lx,0x%x,%d,%d,%ld,%p)\n",
+    TRACE("(%p,%ld,0x%lx,%p,%d,%d,%ld,%p)\n",
 	  pData, cbData, (DWORD)hConv, hszItem, wFmt, wType, dwTimeout,
pdwResult);
 
     if (hConv == 0)
@@ -1165,7 +1168,7 @@
 
     if (!PostMessageA(pConv->hwndServer, pXAct->ddeMsg,
(WPARAM)pConv->hwndClient, pXAct->lParam))
     {
-	TRACE("Failed posting message %d to 0x%04x (error=0x%lx)\n",
+	TRACE("Failed posting message %d to %p (error=0x%lx)\n",
 	      pXAct->ddeMsg, pConv->hwndServer, GetLastError());
 	pConv->wStatus &= ~ST_CONNECTED;
 	WDML_UnQueueTransaction(pConv, pXAct);
Index: dlls/user/dde/ddeml16.c
===================================================================
RCS file: /home/wine/wine/dlls/user/dde/ddeml16.c,v
retrieving revision 1.8
diff -u -u -r1.8 ddeml16.c
--- dlls/user/dde/ddeml16.c	7 Oct 2002 18:21:03 -0000	1.8
+++ dlls/user/dde/ddeml16.c	22 Nov 2002 20:43:37 -0000
@@ -120,8 +120,9 @@
         d1 = dwData1;
         break;
     }
-    ret = WDML_CallTo16_long_llllllll((FARPROC16)pfn, uType, uFmt,
hConv,
-                                      hsz1, hsz2, hdata, d1, dwData2);
+    ret =
(HDDEDATA)(ULONG_PTR)WDML_CallTo16_long_llllllll((FARPROC16)pfn, uType,
uFmt,
+							   LOWORD(hConv), LOWORD(hsz1),
+							   LOWORD(hsz2), LOWORD(hdata), d1, dwData2);
     switch (uType)
     {
     case XTYP_CONNECT:
Index: dlls/user/dde/misc.c
===================================================================
RCS file: /home/wine/wine/dlls/user/dde/misc.c,v
retrieving revision 1.13
diff -u -u -r1.13 misc.c
--- dlls/user/dde/misc.c	19 Oct 2002 00:51:00 -0000	1.13
+++ dlls/user/dde/misc.c	22 Nov 2002 20:43:38 -0000
@@ -42,6 +42,8 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(ddeml);
 
+#define HCONV_32(h16)  ((HCONV)(ULONG_PTR)(h16))
+
 /* convert between ATOM and HSZ avoiding compiler warnings */
 #define ATOM2HSZ(atom)	((HSZ)	(ULONG_PTR)(atom))
 #define HSZ2ATOM(hsz)	((ATOM)	(ULONG_PTR)(hsz))
@@ -82,7 +84,7 @@
         }
         if (!(params = GlobalLock(hMem)))
         {
-            ERR("GlobalLock failed (%x)\n", hMem);
+            ERR("GlobalLock failed (%p)\n", hMem);
             return 0;
         }
         params[0] = uiLo;
@@ -224,7 +226,7 @@
  */
 BOOL WINAPI ImpersonateDdeClientWindow(HWND hWndClient, HWND
hWndServer)
 {
-     FIXME("(%04x %04x): stub\n", hWndClient, hWndServer);
+     FIXME("(%p %p): stub\n", hWndClient, hWndServer);
      return FALSE;
 }
 
@@ -235,7 +237,7 @@
 BOOL WINAPI DdeSetQualityOfService(HWND hwndClient, CONST
SECURITY_QUALITY_OF_SERVICE *pqosNew,
 				   PSECURITY_QUALITY_OF_SERVICE pqosPrev)
 {
-     FIXME("(%04x %p %p): stub\n", hwndClient, pqosNew, pqosPrev);
+     FIXME("(%p %p %p): stub\n", hwndClient, pqosNew, pqosPrev);
      return TRUE;
 }
 
@@ -716,7 +718,7 @@
 
     if (pInstance == NULL)
 	return (HDDEDATA)0;
-    TRACE("invoking CB%d[%08lx] (%u %u %08lx 0x%x 0x%x %u %lu %lu)\n",
+    TRACE("invoking CB%d[%08lx] (%u %u %08lx %p %p %p %lu %lu)\n",
 	  pInstance->win16 ? 16 : 32, (DWORD)pInstance->callback, uType, uFmt,
 	  (DWORD)hConv, hsz1, hsz2, hdata, dwData1, dwData2);
     if (pInstance->win16)
@@ -826,7 +828,7 @@
     {
 	if (pNode->hsz == hsz) break;
     }
-    if (!pNode) WARN("HSZ 0x%x not found\n", hsz);
+    if (!pNode) WARN("HSZ %p not found\n", hsz);
     return pNode;
 }
 
@@ -842,7 +844,7 @@
 
     if (GetAtomNameW(HSZ2ATOM(hsz), nameBuffer, MAX_BUFFER_LEN))
 	return GlobalAddAtomW(nameBuffer);
-    WARN("HSZ 0x%x not found\n", hsz);
+    WARN("HSZ %p not found\n", hsz);
     return 0;
 }
 
@@ -919,7 +921,7 @@
 	    return TRUE;
 	}
     }
-    WARN("HSZ 0x%x not found\n", hsz);
+    WARN("HSZ %p not found\n", hsz);
 
     return FALSE;
 }
@@ -1008,7 +1010,7 @@
     DWORD		ret = 0;
     WDML_INSTANCE*	pInstance;
 
-    TRACE("(%ld, 0x%x, %p, %ld, %d)\n", idInst, hsz, psz, cchMax,
iCodePage);
+    TRACE("(%ld, %p, %p, %ld, %d)\n", idInst, hsz, psz, cchMax,
iCodePage);
 
     EnterCriticalSection(&WDML_CritSect);
 
@@ -1035,7 +1037,7 @@
     DWORD		ret = 0;
     WDML_INSTANCE*	pInstance;
 
-    TRACE("(%ld, 0x%x, %p, %ld, %d)\n", idInst, hsz, psz, cchMax,
iCodePage);
+    TRACE("(%ld, %p, %p, %ld, %d)\n", idInst, hsz, psz, cchMax,
iCodePage);
 
     EnterCriticalSection(&WDML_CritSect);
 
@@ -1066,11 +1068,11 @@
     {
     case CP_WINANSI:
 	hsz = ATOM2HSZ(AddAtomA(ptr));
-	TRACE("added atom %s with HSZ 0x%x, \n", debugstr_a(ptr), hsz);
+	TRACE("added atom %s with HSZ %p, \n", debugstr_a(ptr), hsz);
 	break;
     case CP_WINUNICODE:
 	hsz = ATOM2HSZ(AddAtomW(ptr));
-	TRACE("added atom %s with HSZ 0x%x, \n", debugstr_w(ptr), hsz);
+	TRACE("added atom %s with HSZ %p, \n", debugstr_w(ptr), hsz);
 	break;
     default:
 	ERR("Unknown code page %d\n", codepage);
@@ -1149,7 +1151,7 @@
     WDML_INSTANCE*	pInstance;
     BOOL		ret = FALSE;
 
-    TRACE("(%ld,0x%x): \n", idInst, hsz);
+    TRACE("(%ld,%p): \n", idInst, hsz);
 
     EnterCriticalSection(&WDML_CritSect);
 
@@ -1175,7 +1177,7 @@
     WDML_INSTANCE*	pInstance;
     BOOL		ret = FALSE;
 
-    TRACE("(%ld,0x%x): \n", idInst, hsz);
+    TRACE("(%ld,%p): \n", idInst, hsz);
 
     EnterCriticalSection(&WDML_CritSect);
 
@@ -1210,7 +1212,7 @@
     ret1 = GetAtomNameW(HSZ2ATOM(hsz1), psz1, MAX_BUFFER_LEN);
     ret2 = GetAtomNameW(HSZ2ATOM(hsz2), psz2, MAX_BUFFER_LEN);
 
-    TRACE("(%x<%s> %x<%s>);\n", hsz1, debugstr_w(psz1), hsz2,
debugstr_w(psz2));
+    TRACE("(%p<%s> %p<%s>);\n", hsz1, debugstr_w(psz1), hsz2,
debugstr_w(psz2));
 
     /* Make sure we found both strings. */
     if (ret1 == 0 && ret2 == 0)
@@ -1397,7 +1399,7 @@
     pDdh = (DDE_DATAHANDLE_HEAD*)GlobalLock(hMem);
     if (pDdh == NULL)
     {
-	ERR("Failed on GlobalLock(%04x)\n", hMem);
+	ERR("Failed on GlobalLock(%p)\n", hMem);
 	return 0;
     }
 
@@ -1826,7 +1828,7 @@
  */
 BOOL WINAPI DdeEnableCallback(DWORD idInst, HCONV hConv, UINT wCmd)
 {
-    FIXME("(%ld, 0x%x, %d) stub\n", idInst, hConv, wCmd);
+    FIXME("(%ld, %p, %d) stub\n", idInst, hConv, wCmd);
 
     return 0;
 }
@@ -2049,7 +2051,7 @@
     }
     else if ((DWORD)hConv & 1)
     {
-	pConv = WDML_GetConv((DWORD)hConv & ~1, FALSE);
+	pConv = WDML_GetConv( HCONV_32(((DWORD)hConv) & ~1), FALSE);
 	if (pConv != NULL)
 	{
 	    FIXME("Request on remote conversation information is not
implemented yet\n");
Index: dlls/user/dde/server.c
===================================================================
RCS file: /home/wine/wine/dlls/user/dde/server.c,v
retrieving revision 1.8
diff -u -u -r1.8 server.c
--- dlls/user/dde/server.c	31 May 2002 23:40:54 -0000	1.8
+++ dlls/user/dde/server.c	22 Nov 2002 20:43:38 -0000
@@ -67,7 +67,7 @@
     ATOM		atom = 0;
     UINT		count;
 
-    TRACE("(%ld,0x%x,0x%x)\n", idInst, hszTopic, hszItem);
+    TRACE("(%ld,%p,%p)\n", idInst, hszTopic, hszItem);
 
     EnterCriticalSection(&WDML_CritSect);
 
@@ -176,7 +176,7 @@
 
     hDdeData = (HDDEDATA)NULL;
 
-    TRACE("(%ld,0x%x,0x%x,%d)\n", idInst, hsz1, hsz2, afCmd);
+    TRACE("(%ld,%p,%p,%d)\n", idInst, hsz1, hsz2, afCmd);
 
     EnterCriticalSection(&WDML_CritSect);
 
@@ -251,7 +251,7 @@
 
 	SetWindowLongA(hwndServer, GWL_WDML_INSTANCE, (DWORD)pInstance);
 	SetWindowLongA(hwndServer, GWL_WDML_SERVER, (DWORD)pServer);
-	TRACE("Created nameServer=%04x for instance=%08lx\n", hwndServer,
idInst);
+	TRACE("Created nameServer=%p for instance=%08lx\n", hwndServer,
idInst);
 
 	pServer->hwndServer = hwndServer;
 	break;
@@ -356,7 +356,7 @@
 				       hwndServerName, 0, 0, 0);
     }
 
-    TRACE("Created convServer=%04x (nameServer=%04x) for
instance=%08lx\n",
+    TRACE("Created convServer=%p (nameServer=%p) for instance=%08lx\n",
 	  hwndServerConv, hwndServerName, pInstance->instanceID);
 
     pConv = WDML_AddConv(pInstance, WDML_SERVER_SIDE, hszApp, hszTopic,
@@ -794,7 +794,7 @@
     case DDE_FNOTPROCESSED:
 	break;
     }
-    WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, fBusy, fAck, pXAct->hMem,
0, 0);
+    WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, fBusy, fAck,
LOWORD(pXAct->hMem), 0, 0);
 
     return WDML_QS_HANDLED;
 }
Index: windows/class.c
===================================================================
RCS file: /home/wine/wine/windows/class.c,v
retrieving revision 1.53
diff -u -u -r1.53 class.c
--- windows/class.c	22 Nov 2002 04:47:10 -0000	1.53
+++ windows/class.c	22 Nov 2002 20:43:39 -0000
@@ -48,6 +48,12 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(class);
 
+/* #define HMODULE_16(h32)   (LOWORD(h32)) */
+/* #define HUSER_16(h32)     (LOWORD(h32)) */
+/* #define HINSTANCE_16(h32) (LOWORD(h32)) */
+/* #define HINSTANCE_32(h32) ((HINSTANCE)(ULONG_PTR)(h32)) */
+/* #define HANDLE_16(h32)    (LOWORD(h32)) */
+
 typedef struct tagCLASS
 {
     struct tagCLASS *next;          /* Next class */
@@ -89,7 +95,7 @@
                 SetLastError( ERROR_ACCESS_DENIED );
                 return NULL;
             }
-            FIXME( "reading from class of other process window %04x\n",
hwnd );
+            FIXME( "reading from class of other process window %p\n",
hwnd );
             /* DbgBreakPoint(); */
         }
     }
@@ -298,7 +304,9 @@
     for (ptr = firstClass; ptr; ptr = next)
     {
         next = ptr->next;
-	if (ptr->hInstance == hModule) CLASS_FreeClass( ptr );
+	if (HMODULE_16(ptr->hInstance) == hModule) {
+		CLASS_FreeClass( ptr );
+	}
     }
     USER_Unlock();
 }
@@ -322,7 +330,7 @@
     CLASS * class, *tclass = 0, *user_class = 0;
     HINSTANCE16 hUser = GetModuleHandle16("USER");
 
-    TRACE("0x%08x 0x%08x\n", atom, hinstance);
+    TRACE("0x%08x %p\n", atom, hinstance);
 
     /* First search task-specific classes */
 
@@ -331,13 +339,14 @@
         if (class->style & CS_GLOBALCLASS) continue;
         if (class->atomName == atom)
         {
-            if (hinstance==class->hInstance || hinstance==0xffff)
+            if (hinstance==class->hInstance || (int)hinstance==0xffff)
             {
                 TRACE("-- found local %p\n", class);
                 return class;
             }
-            if (class->hInstance == 0) tclass = class;
-            else if(class->hInstance == hUser)
+            if (class->hInstance == 0)
+                tclass = class;
+            else if(HUSER_16(class->hInstance) == hUser)
             {
                 user_class = class;
             }
@@ -385,7 +394,7 @@
 {
     CLASS *classPtr;
 
-    TRACE("atom=0x%x hinst=0x%x style=0x%lx clExtr=0x%x
winExtr=0x%x\n",
+    TRACE("atom=0x%x hinst=%p style=0x%lx clExtr=0x%x winExtr=0x%x\n",
           atom, hInstance, style, classExtra, winExtra );
 
    /* Check if a class with this name already exists */
@@ -494,7 +503,7 @@
                         INT *winExtra, WNDPROC *winproc, DWORD *style,
struct tagDCE **dce )
 {
     CLASS *class;
-    if (type == WIN_PROC_16) inst = GetExePtr(inst);
+    if (type == WIN_PROC_16) inst =
HINSTANCE_32(GetExePtr(HANDLE_16(inst)));
 
     if (!(class = CLASS_FindClassByAtom( atom, inst ))) return NULL;
     class->cWindows++;
@@ -536,7 +545,7 @@
     HINSTANCE16 hInstance=GetExePtr(wc->hInstance);
 
     if (!(atom = GlobalAddAtomA( MapSL(wc->lpszClassName) ))) return 0;
-    if (!(classPtr = CLASS_RegisterClass( atom, hInstance, wc->style,
+    if (!(classPtr = CLASS_RegisterClass( atom,
HINSTANCE_32(hInstance), wc->style,
                                           wc->cbClsExtra,
wc->cbWndExtra )))
     {
         GlobalDeleteAtom( atom );
@@ -555,7 +564,7 @@
     iSmIconHeight = GetSystemMetrics(SM_CYSMICON);
 
     classPtr->hIcon         = HICON_32(wc->hIcon);
-    classPtr->hIconSm       = CopyImage(wc->hIcon, IMAGE_ICON,
+    classPtr->hIconSm       = CopyImage(classPtr->hIcon, IMAGE_ICON,
 					iSmIconWidth, iSmIconHeight,
 					LR_COPYFROMRESOURCE);
     classPtr->hCursor       = HCURSOR_32(wc->hCursor);
@@ -590,7 +599,7 @@
         return 0;
     }
 
-    TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x
clsExt=%d winExt=%d class=%p name='%s'\n",
+    TRACE("atom=%04x wndproc=%08lx hinst=%p bg=%p 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,
@@ -631,7 +640,7 @@
         return 0;
     }
 
-    TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x
clsExt=%d winExt=%d class=%p\n",
+    TRACE("atom=%04x wndproc=%08lx hinst=%p bg=%p style=%08x clsExt=%d
winExt=%d class=%p\n",
                    atom, (DWORD)wc->lpfnWndProc, wc->hInstance,
                    wc->hbrBackground, wc->style, wc->cbClsExtra,
                    wc->cbWndExtra, classPtr );
@@ -663,7 +672,8 @@
     HINSTANCE16 hInstance = GetExePtr( wc->hInstance );
 
     if (!(atom = GlobalAddAtomA( MapSL(wc->lpszClassName) ))) return 0;
-    if (!(classPtr = CLASS_RegisterClass( atom, hInstance, wc->style,
+    if (!(classPtr = CLASS_RegisterClass( atom, HINSTANCE_32(hInstance)
+					  , wc->style,
                                           wc->cbClsExtra,
wc->cbWndExtra )))
     {
         GlobalDeleteAtom( atom );
@@ -704,7 +714,7 @@
         return 0;
     }
 
-    TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x
clsExt=%d winExt=%d class=%p\n",
+    TRACE("atom=%04x wndproc=%08lx hinst=%p bg=%p style=%08x clsExt=%d
winExt=%d class=%p\n",
                    atom, (DWORD)wc->lpfnWndProc, wc->hInstance,
                    wc->hbrBackground, wc->style, wc->cbClsExtra,
                    wc->cbWndExtra, classPtr );
@@ -737,7 +747,7 @@
         return 0;
     }
 
-    TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x
clsExt=%d winExt=%d class=%p\n",
+    TRACE("atom=%04x wndproc=%08lx hinst=%p bg=%p style=%08x clsExt=%d
winExt=%d class=%p\n",
                    atom, (DWORD)wc->lpfnWndProc, wc->hInstance,
                    wc->hbrBackground, wc->style, wc->cbClsExtra,
                    wc->cbWndExtra, classPtr );
@@ -758,7 +768,7 @@
  */
 BOOL16 WINAPI UnregisterClass16( LPCSTR className, HINSTANCE16
hInstance )
 {
-    return UnregisterClassA( className, GetExePtr( hInstance ) );
+    return UnregisterClassA( className, HINSTANCE_32( GetExePtr(
hInstance )));
 }
 

/***********************************************************************
@@ -767,7 +777,7 @@
  */
 BOOL WINAPI UnregisterClassA( LPCSTR className, HINSTANCE hInstance )
 {
-    TRACE("%s %x\n",debugstr_a(className), hInstance);
+    TRACE("%s %p\n",debugstr_a(className), hInstance);
     return CLASS_UnregisterClass( GlobalFindAtomA( className ),
hInstance );
 }
 
@@ -776,7 +786,7 @@
  */
 BOOL WINAPI UnregisterClassW( LPCWSTR className, HINSTANCE hInstance )
 {
-    TRACE("%s %x\n",debugstr_w(className), hInstance);
+    TRACE("%s %p\n",debugstr_w(className), hInstance);
     return CLASS_UnregisterClass( GlobalFindAtomW( className ),
hInstance );
 }
 
@@ -791,7 +801,7 @@
 
     if (offset < 0) return GetClassLongA( hwnd, offset );
 
-    TRACE("%x %x\n",hwnd, offset);
+    TRACE("%p %x\n",hwnd, offset);
 
     if (!(class = get_class_ptr( hwnd, FALSE ))) return 0;
 
@@ -813,7 +823,7 @@
     LONG ret;
     HWND hwnd = (HWND)(ULONG_PTR)hwnd16;  /* no need for full handle */
 
-    TRACE("%x %d\n",hwnd, offset);
+    TRACE("%p %d\n",hwnd, offset);
 
     switch( offset )
     {
@@ -841,7 +851,7 @@
     CLASS *class;
     LONG retvalue = 0;
 
-    TRACE("%x %d\n", hwnd, offset);
+    TRACE("%p %d\n", hwnd, offset);
 
     if (!(class = get_class_ptr( hwnd, FALSE ))) return 0;
 
@@ -910,7 +920,7 @@
     if (offset != GCL_WNDPROC && offset != GCL_MENUNAME)
         return GetClassLongW( hwnd, offset );
 
-    TRACE("%x %d\n", hwnd, offset);
+    TRACE("%p %d\n", hwnd, offset);
 
     if (!(class = get_class_ptr( hwnd, FALSE ))) return 0;
 
@@ -934,7 +944,7 @@
 
     if (offset < 0) return SetClassLongA( hwnd, offset, (DWORD)newval
);
 
-    TRACE("%x %d %x\n", hwnd, offset, newval);
+    TRACE("%p %d %x\n", hwnd, offset, newval);
 
     if (!(class = get_class_ptr( hwnd, TRUE ))) return 0;
 
@@ -960,7 +970,7 @@
     LONG retval;
     HWND hwnd = (HWND)(ULONG_PTR)hwnd16;  /* no need for full handle */
 
-    TRACE("%x %d %lx\n", hwnd, offset, newval);
+    TRACE("%p %d %lx\n", hwnd, offset, newval);
 
     switch(offset)
     {
@@ -986,7 +996,7 @@
     CLASS *class;
     LONG retval = 0;
 
-    TRACE("%x %d %lx\n", hwnd, offset, newval);
+    TRACE("%p %d %lx\n", hwnd, offset, newval);
 
     if (!(class = get_class_ptr( hwnd, TRUE ))) return 0;
 
@@ -1064,7 +1074,7 @@
     if (offset != GCL_WNDPROC && offset != GCL_MENUNAME)
         return SetClassLongW( hwnd, offset, newval );
 
-    TRACE("%x %d %lx\n", hwnd, offset, newval);
+    TRACE("%p %d %lx\n", hwnd, offset, newval);
 
     if (!(class = get_class_ptr( hwnd, TRUE ))) return 0;
 
@@ -1087,7 +1097,7 @@
 {
     INT ret = GlobalGetAtomNameA( GetClassLongA( hwnd, GCW_ATOM ),
buffer, count );
 
-    TRACE("%x %s %x\n",hwnd, debugstr_a(buffer), count);
+    TRACE("%p %s %x\n",hwnd, debugstr_a(buffer), count);
     return ret;
 }
 
@@ -1099,7 +1109,7 @@
 {
     INT ret = GlobalGetAtomNameW( GetClassLongW( hwnd, GCW_ATOM ),
buffer, count );
 
-    TRACE("%x %s %x\n",hwnd, debugstr_w(buffer), count);
+    TRACE("%p %s %x\n",hwnd, debugstr_w(buffer), count);
     return ret;
 }
 
@@ -1116,16 +1126,16 @@
 
     hInstance = GetExePtr( hInstance );
     if (!(atom = GlobalFindAtomA( MapSL(name) )) ||
-        !(classPtr = CLASS_FindClassByAtom( atom, hInstance )))
+        !(classPtr = CLASS_FindClassByAtom( atom, HINSTANCE_32(
hInstance ))))
         return FALSE;
-    if ((hInstance != classPtr->hInstance) &&
+    if (hInstance != HINSTANCE_16(classPtr->hInstance) &&
         !(classPtr->style & CS_GLOBALCLASS)) /*BWCC likes to pass
hInstance=0*/
         return FALSE;
     wc->style         = (UINT16)classPtr->style;
     wc->lpfnWndProc   = CLASS_GetProc( classPtr, WIN_PROC_16 );
     wc->cbClsExtra    = (INT16)classPtr->cbClsExtra;
     wc->cbWndExtra    = (INT16)classPtr->cbWndExtra;
-    wc->hInstance     = classPtr->style & CS_GLOBALCLASS ?
GetModuleHandle16("USER") : (HINSTANCE16)classPtr->hInstance;
+    wc->hInstance     = classPtr->style & CS_GLOBALCLASS ?
GetModuleHandle16("USER") : HINSTANCE_16(classPtr->hInstance);
     wc->hIcon         = HICON_16(classPtr->hIcon);
     wc->hCursor       = HCURSOR_16(classPtr->hCursor);
     wc->hbrBackground = HBRUSH_16(classPtr->hbrBackground);
@@ -1144,7 +1154,7 @@
     ATOM atom;
     CLASS *classPtr;
 
-    TRACE("%x %p %p\n",hInstance, name, wc);
+    TRACE("%p %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
@@ -1185,7 +1195,7 @@
     ATOM atom;
     CLASS *classPtr;
 
-    TRACE("%x %p %p\n",hInstance, name, wc);
+    TRACE("%p %p %p\n",hInstance, name, wc);
 
     if (	!(atom=GlobalFindAtomW(name)) ||
 		!(classPtr=CLASS_FindClassByAtom(atom,hInstance))
@@ -1228,13 +1238,13 @@
 
     hInstance = GetExePtr( hInstance );
     if (!(atom = GlobalFindAtomA( MapSL(name) )) ||
-        !(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
-        (hInstance != classPtr->hInstance)) return FALSE;
+        !(classPtr = CLASS_FindClassByAtom( atom, HINSTANCE_32(
hInstance ))) ||
+        (hInstance != HINSTANCE_16( classPtr->hInstance ))) return
FALSE;
     wc->style         = classPtr->style;
     wc->lpfnWndProc   = CLASS_GetProc( classPtr, WIN_PROC_16 );
     wc->cbClsExtra    = (INT16)classPtr->cbClsExtra;
     wc->cbWndExtra    = (INT16)classPtr->cbWndExtra;
-    wc->hInstance     = (HINSTANCE16)classPtr->hInstance;
+    wc->hInstance     = HINSTANCE_16(classPtr->hInstance);
     wc->hIcon         = HICON_16(classPtr->hIcon);
     wc->hIconSm       = HICON_16(classPtr->hIconSm);
     wc->hCursor       = HCURSOR_16(classPtr->hCursor);
@@ -1257,7 +1267,7 @@
     ATOM atom;
     CLASS *classPtr;
 
-    TRACE("%x %p %p\n",hInstance, name, wc);
+    TRACE("%p %p %p\n",hInstance, name, wc);
 
     if (!(atom = GlobalFindAtomA( name )) ||
         !(classPtr = CLASS_FindClassByAtom( atom, hInstance ))
@@ -1288,7 +1298,7 @@
     ATOM atom;
     CLASS *classPtr;
 
-    TRACE("%x %p %p\n",hInstance, name, wc);
+    TRACE("%p %p %p\n",hInstance, name, wc);
 
     if (!(atom = GlobalFindAtomW( name )) ||
         !(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
Index: windows/clipboard.c
===================================================================
RCS file: /home/wine/wine/windows/clipboard.c,v
retrieving revision 1.54
diff -u -u -r1.54 clipboard.c
--- windows/clipboard.c	22 Nov 2002 04:47:10 -0000	1.54
+++ windows/clipboard.c	22 Nov 2002 20:43:39 -0000
@@ -57,6 +57,8 @@
 
 #define  CF_REGFORMATBASE 	0xC000
 
+#define HANDLE_32(h32)     ((HANDLE)(ULONG_PTR)(h32))
+

/**************************************************************************
  *	  Clipboard context global variables
  */
@@ -207,7 +209,7 @@
       if (lpFormat->hData32)
 	DeleteObject(lpFormat->hData32);
       if (lpFormat->hData16)
-	DeleteObject(lpFormat->hData16);
+	DeleteObject(HANDLE_32(lpFormat->hData16));
     }
     else if( lpFormat->wFormatID == CF_METAFILEPICT )
     {
@@ -443,7 +445,7 @@
     }
     else
     {
-      WARN("\thWndClipOwner (%04x) is lost!\n",
+      WARN("\thWndClipOwner (%p) is lost!\n",
 	   hWndClipOwner);
       CLIPBOARD_ReleaseOwner();
       lpFormat->wDataPresent = 0;
@@ -750,7 +752,7 @@
 {
     BOOL bRet;
 
-    TRACE("(%04x)...\n", hWnd);
+    TRACE("(%p)...\n", hWnd);
 
     if (!ClipLock)
     {
@@ -913,7 +915,7 @@
 {
     LPWINE_CLIPFORMAT lpFormat = __lookup_format( ClipFormats, wFormat
);
 
-    TRACE("(%08X, %08x) !\n", wFormat, hData);
+    TRACE("(%08X, %p) !\n", wFormat, hData);
 
     /* NOTE: If the hData is zero and current owner doesn't match
      * the window that opened the clipboard then this application
@@ -1097,7 +1099,7 @@
       GlobalUnlock16(lpRender->hData16);
     }
 
-    TRACE("\treturning %04x (type %i)\n",
+    TRACE("\treturning %p (type %i)\n",
 			      lpRender->hData32, lpRender->wFormatID);
     return lpRender->hData32;
 }
@@ -1330,7 +1332,7 @@
 {
     HWND hwndPrev = hWndViewer;
 
-    TRACE("(%04x): returning %04x\n", hWnd, hwndPrev);
+    TRACE("(%p): returning %p\n", hWnd, hwndPrev);
 
     hWndViewer = WIN_GetFullHandle( hWnd );
     return hwndPrev;
@@ -1354,7 +1356,7 @@
 {
     BOOL bRet = 0;
 
-    FIXME("(0x%04x, 0x%04x): stub?\n", hWnd, hWndNext);
+    FIXME("(%p, %p): stub?\n", hWnd, hWndNext);
 
     if( hWndViewer )
         bRet = !SendMessageW( hWndViewer, WM_CHANGECBCHAIN,
(WPARAM)hWnd, (LPARAM)hWndNext );
Index: windows/cursoricon.c
===================================================================
RCS file: /home/wine/wine/windows/cursoricon.c,v
retrieving revision 1.58
diff -u -u -r1.58 cursoricon.c
--- windows/cursoricon.c	21 Nov 2002 21:48:06 -0000	1.58
+++ windows/cursoricon.c	22 Nov 2002 20:43:40 -0000
@@ -67,7 +67,6 @@
 WINE_DECLARE_DEBUG_CHANNEL(icon);
 WINE_DECLARE_DEBUG_CHANNEL(resource);
 
-
 static RECT CURSOR_ClipRect;       /* Cursor clipping rect */
 
 static HDC screen_dc;
@@ -266,11 +265,11 @@
 void CURSORICON_FreeModuleIcons( HMODULE hModule )
 {
     ICONCACHE **ptr = &IconAnchor;
-
+    
     if ( HIWORD( hModule ) )
-        hModule = MapHModuleLS( hModule );
+        hModule = HMODULE_32( MapHModuleLS( hModule ));
     else
-        hModule = GetExePtr( hModule );
+        hModule = HMODULE_32( GetExePtr( HANDLE_16( hModule )));
 
     EnterCriticalSection( &IconCrst );
 
@@ -761,10 +760,10 @@
         /* Normalize hInstance (must be uniquely represented for icon
cache) */
 
         if ( HIWORD( hInstance ) )
-            hInstance = MapHModuleLS( hInstance );
-        else
-            hInstance = GetExePtr( hInstance );
-
+	    hInstance = HINSTANCE_32( MapHModuleLS( hInstance ));
+	else
+	    hInstance = HINSTANCE_32( GetExePtr( HANDLE_16( hInstance )));
+ 
         /* Get directory resource ID */
 
         if (!(hRsrc = FindResourceW( hInstance, name,
@@ -865,7 +864,7 @@
 {
     HICON hNew=0;
 
-    TRACE_(icon)("hIcon %u, nType %u, iDesiredCX %i, iDesiredCY %i,
nFlags %u\n",
+    TRACE_(icon)("hIcon %p, nType %u, iDesiredCX %i, iDesiredCY %i,
nFlags %u\n",
         hIcon, nType, iDesiredCX, iDesiredCY, nFlags);
 
     if(hIcon == 0)
@@ -1171,7 +1170,7 @@
  */
 HICON WINAPI CopyIcon( HICON hIcon )
 {
-    TRACE_(icon)("%04x\n", hIcon );
+    TRACE_(icon)("%p\n", hIcon );
     return CURSORICON_Copy( 0, hIcon );
 }
 
@@ -1310,7 +1309,7 @@
     HCURSOR hOldCursor;
 
     if (hCursor == queue->cursor) return hCursor;  /* No change */
-    TRACE_(cursor)("%04x\n", hCursor );
+    TRACE_(cursor)("%p\n", hCursor );
     hOldCursor = queue->cursor;
     queue->cursor = hCursor;
     /* Change the cursor shape only if it is visible */
@@ -1732,7 +1731,7 @@
     HBITMAP hB_off = 0, hOld = 0;
 
     if (!ptr) return FALSE;
-   
TRACE_(icon)("(hdc=%x,pos=%d.%d,hicon=%x,extend=%d.%d,istep=%d,br=%x,flags=0x%08x)\n",
+   
TRACE_(icon)("(hdc=%p,pos=%d.%d,hicon=%p,extend=%d.%d,istep=%d,br=%p,flags=0x%08x)\n",
 	    hdc,x0,y0,hIcon,cxWidth,cyWidth,istep,hbr,flags
     );
 
@@ -2033,10 +2032,10 @@
                 INT desiredx, INT desiredy, UINT loadflags )
 {
     if (HIWORD(name)) {
-        TRACE_(resource)("(0x%04x,%p,%d,%d,%d,0x%08x)\n",
+        TRACE_(resource)("(%p,%p,%d,%d,%d,0x%08x)\n",
 	      hinst,name,type,desiredx,desiredy,loadflags);
     } else {
-        TRACE_(resource)("(0x%04x,%p,%d,%d,%d,0x%08x)\n",
+        TRACE_(resource)("(%p,%p,%d,%d,%d,0x%08x)\n",
 	      hinst,name,type,desiredx,desiredy,loadflags);
     }
     if (loadflags & LR_DEFAULTSIZE) {
Index: windows/dce.c
===================================================================
RCS file: /home/wine/wine/windows/dce.c,v
retrieving revision 1.74
diff -u -u -r1.74 dce.c
--- windows/dce.c	22 Nov 2002 04:47:10 -0000	1.74
+++ windows/dce.c	22 Nov 2002 20:43:41 -0000
@@ -44,8 +44,10 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(dc);
 
+#define HDC_16(h32) (LOWORD(h32))
+
 static DCE *firstDCE;
-static HDC defaultDCstate;
+static HDC16 defaultDCstate;
 
 static void DCE_DeleteClipRgn( DCE* );
 static INT DCE_ReleaseDC( DCE* );
@@ -64,7 +66,7 @@
     DPRINTF("DCE:\n");
     while( dce )
     {
-	DPRINTF("\t[0x%08x] hWnd 0x%04x, dcx %08x, %s %s\n",
+	DPRINTF("\t[0%08x] hWnd %p, dcx %08x, %s %s\n",
 	     (unsigned)dce, dce->hwndCurrent, (unsigned)dce->DCXflags,
 	     (dce->DCXflags & DCX_CACHE) ? "Cache" : "Owned",
 	     (dce->DCXflags & DCX_DCEBUSY) ? "InUse" : "" );
@@ -89,8 +91,11 @@
         HeapFree( GetProcessHeap(), 0, dce );
 	return 0;
     }
-    if (!defaultDCstate) defaultDCstate = GetDCState16( dce->hDC );
-
+    
+    if (!defaultDCstate) {
+	    defaultDCstate = GetDCState16( HDC_16( dce->hDC ));
+    }
+    
     /* store DCE handle in DC hook data field */
 
     SetDCHook( dce->hDC, DCHook16, (DWORD)dce );
@@ -107,7 +112,7 @@
             if (style & WS_CLIPCHILDREN) dce->DCXflags |=
DCX_CLIPCHILDREN;
             if (style & WS_CLIPSIBLINGS) dce->DCXflags |=
DCX_CLIPSIBLINGS;
 	}
-	SetHookFlags16(dce->hDC,DCHF_INVALIDATEVISRGN);
+	SetHookFlags16(HDC_16( dce->hDC ), DCHF_INVALIDATEVISRGN);
     }
     else dce->DCXflags = DCX_CACHE | DCX_DCEEMPTY;
 
@@ -189,7 +194,7 @@
                      * We should change this to WARN when Wine is more
stable
                      * (for 1.0?).
                      */
-		    ERR("[%08x] GetDC() without ReleaseDC()!\n",hwnd);
+		    ERR("[%p] GetDC() without ReleaseDC()!\n",hwnd);
 		    DCE_ReleaseDC( pDCE );
 		}
 
@@ -223,7 +228,7 @@
 
     /* make it dirty so that the vis rgn gets recomputed next time */
     dce->DCXflags |= DCX_DCEDIRTY;
-    SetHookFlags16( dce->hDC, DCHF_INVALIDATEVISRGN );
+    SetHookFlags16( HDC_16( dce->hDC ), DCHF_INVALIDATEVISRGN );
 }
 
 
@@ -243,8 +248,8 @@
     if (dce->DCXflags & DCX_CACHE)
     {
         /* make the DC clean so that SetDCState doesn't try to update
the vis rgn */
-        SetHookFlags16( dce->hDC, DCHF_VALIDATEVISRGN );
-        SetDCState16( dce->hDC, defaultDCstate );
+        SetHookFlags16( HDC_16( dce->hDC ), DCHF_VALIDATEVISRGN );
+        SetDCState16( HDC_16( dce->hDC ), defaultDCstate );
         dce->DCXflags &= ~DCX_DCEBUSY;
 	if (dce->DCXflags & DCX_DCEDIRTY)
 	{
@@ -279,7 +284,7 @@
     {
 	DCE *dce;
 
-	TRACE("scope hwnd = %04x, (%i,%i - %i,%i)\n",
+	TRACE("scope hwnd = %p, (%i,%i - %i,%i)\n",
 		     hwndScope, pRectUpdate->left,pRectUpdate->top,
 		     pRectUpdate->right,pRectUpdate->bottom);
 	if(TRACE_ON(dc))
@@ -310,7 +315,7 @@
                 {
                     /* Don't bother with visible regions of unused DCEs
*/
 
-                    TRACE("\tpurged %p dce [%04x]\n", dce,
dce->hwndCurrent);
+                    TRACE("\tpurged %p dce [%p]\n", dce,
dce->hwndCurrent);
                     if (dce->hwndCurrent && USER_Driver.pReleaseDC)
                         USER_Driver.pReleaseDC( dce->hwndCurrent,
dce->hDC );
                     dce->hwndCurrent = 0;
@@ -321,9 +326,9 @@
                 {
                     /* Set dirty bits in the hDC and DCE structs */
 
-                    TRACE("\tfixed up %p dce [%04x]\n", dce,
dce->hwndCurrent);
+                    TRACE("\tfixed up %p dce [%p]\n", dce,
dce->hwndCurrent);
                     dce->DCXflags |= DCX_DCEDIRTY;
-                    SetHookFlags16(dce->hDC, DCHF_INVALIDATEVISRGN);
+                    SetHookFlags16( HDC_16( dce->hDC ),
DCHF_INVALIDATEVISRGN);
                     bRet = TRUE;
                 }
             }
@@ -378,13 +383,13 @@
     BOOL	bUpdateClipOrigin = FALSE;
     HWND parent, full;
 
-    TRACE("hwnd %04x, hrgnClip %04x, flags %08x\n",
+    TRACE("hwnd %p, hrgnClip %p, flags %08x\n",
           hwnd, hrgnClip, (unsigned)flags);
 
     if (!hwnd) hwnd = GetDesktopWindow();
     if (!(full = WIN_IsCurrentProcess( hwnd )))
     {
-        FIXME( "not supported yet on other process window %x\n", hwnd
);
+        FIXME( "not supported yet on other process window %p\n", hwnd
);
         return 0;
     }
     hwnd = full;
@@ -460,7 +465,7 @@
 		   ((dce->DCXflags & (DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN |
 				      DCX_CACHE | DCX_WINDOW | DCX_PARENTCLIP)) == dcxFlags))
 		{
-		    TRACE("\tfound valid %08x dce [%04x], flags %08x\n",
+		    TRACE("\tfound valid %08x dce [%p], flags %08x\n",
 					(unsigned)dce, hwnd, (unsigned)dcxFlags );
 		    bUpdateVisRgn = FALSE;
 		    bUpdateClipOrigin = TRUE;
@@ -510,11 +515,13 @@
     dce->DCXflags &= ~DCX_DCEDIRTY;
     hdc = dce->hDC;
 
-    if (bUpdateVisRgn) SetHookFlags16( hdc, DCHF_INVALIDATEVISRGN ); /*
force update */
-
+    if (bUpdateVisRgn) {
+	    SetHookFlags16( HDC_16( hdc ), DCHF_INVALIDATEVISRGN ); /* force
update */
+    }
+    
     if (!USER_Driver.pGetDC( hwnd, hdc, hrgnClip, flags )) hdc = 0;
 
-    TRACE("(%04x,%04x,0x%lx): returning %04x\n", hwnd, hrgnClip, flags,
hdc);
+    TRACE("(%p,%p,0x%lx): returning %p\n", hwnd, hrgnClip, flags, hdc);
 END:
     WIN_ReleasePtr(wndPtr);
     return hdc;
@@ -562,7 +569,7 @@
     USER_Lock();
     dce = firstDCE;
 
-    TRACE("%04x %04x\n", hwnd, hdc );
+    TRACE("%p %p\n", hwnd, hdc );
 
     while (dce && (dce->hDC != hdc)) dce = dce->next;
 
@@ -588,7 +595,7 @@
     TRACE("hDC = %04x, %i\n", hDC, code);
 
     if (!dce) return 0;
-    assert(dce->hDC == hDC);
+    assert( HDC_16( dce->hDC ) == hDC);
 
     /* Grab the windows lock before doing anything else  */
     USER_Lock();
@@ -604,7 +611,7 @@
            {
                /* Dirty bit has been cleared by caller, set it again so
that
                 * pGetDC recomputes the visible region. */
-               SetHookFlags16( dce->hDC, DCHF_INVALIDATEVISRGN );
+               SetHookFlags16( HDC_16( dce->hDC ),
DCHF_INVALIDATEVISRGN );
                USER_Driver.pGetDC( dce->hwndCurrent, dce->hDC,
dce->hClipRgn, dce->DCXflags );
            }
            else /* non-fatal but shouldn't happen */
@@ -661,7 +668,7 @@
 {
     static HWND lockedWnd;
 
-    FIXME("(%x), partial stub!\n",hwnd);
+    FIXME("(%p), partial stub!\n",hwnd);
 
     USER_Lock();
     if (lockedWnd)
Index: windows/defdlg.c
===================================================================
RCS file: /home/wine/wine/windows/defdlg.c,v
retrieving revision 1.26
diff -u -u -r1.26 defdlg.c
--- windows/defdlg.c	28 Oct 2002 20:11:40 -0000	1.26
+++ windows/defdlg.c	22 Nov 2002 20:43:41 -0000
@@ -41,7 +41,7 @@
     if (!wndPtr) return 0;
     if (wndPtr == WND_OTHER_PROCESS)
     {
-        ERR( "cannot get dlg proc %x from other process\n", hwnd );
+        ERR( "cannot get dlg proc %p from other process\n", hwnd );
         return 0;
     }
     ret = *(WNDPROC *)((char *)wndPtr->wExtra + DWL_DLGPROC);
Index: windows/defwnd.c
===================================================================
RCS file: /home/wine/wine/windows/defwnd.c,v
retrieving revision 1.78
diff -u -u -r1.78 defwnd.c
--- windows/defwnd.c	30 Oct 2002 23:45:38 -0000	1.78
+++ windows/defwnd.c	22 Nov 2002 20:43:41 -0000
@@ -196,7 +196,7 @@
     WND *wndPtr = WIN_FindWndPtr( hwnd );
     BOOL bVisible = wndPtr->dwStyle & WS_VISIBLE;
 
-    TRACE("%04x %i\n", hwnd, (wParam!=0) );
+    TRACE("%p %i\n", hwnd, (wParam!=0) );
 
     if( wParam )
     {
@@ -684,7 +684,7 @@
     if (!WIN_IsCurrentProcess( hwnd ))
     {
         if (!IsWindow( hwnd )) return 0;
-        ERR( "called for other process window %x\n", hwnd );
+        ERR( "called for other process window %p\n", hwnd );
         return 0;
     }
     SPY_EnterMessage( SPY_DEFWNDPROC16, hwnd, msg, wParam, lParam );
@@ -749,7 +749,7 @@
     if (!(full_handle = WIN_IsCurrentProcess( hwnd )))
     {
         if (!IsWindow( hwnd )) return 0;
-        ERR( "called for other process window %x\n", hwnd );
+        ERR( "called for other process window %p\n", hwnd );
         return 0;
     }
     hwnd = full_handle;
@@ -890,7 +890,7 @@
     if (!(full_handle = WIN_IsCurrentProcess( hwnd )))
     {
         if (!IsWindow( hwnd )) return 0;
-        ERR( "called for other process window %x\n", hwnd );
+        ERR( "called for other process window %p\n", hwnd );
         return 0;
     }
     hwnd = full_handle;
Index: windows/dialog.c
===================================================================
RCS file: /home/wine/wine/windows/dialog.c,v
retrieving revision 1.108
diff -u -u -r1.108 dialog.c
--- windows/dialog.c	31 Oct 2002 01:04:39 -0000	1.108
+++ windows/dialog.c	22 Nov 2002 20:43:42 -0000
@@ -46,7 +46,6 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(dialog);
 
-
   /* Dialog control information */
 typedef struct
 {
@@ -442,8 +441,9 @@
                     LocalInit16(dlgInfo->hDialogHeap, 0, 0xffff);
                 }
                 instance = dlgInfo->hDialogHeap;
-            }
-            else instance = (HINSTANCE16)hInst;
+            } else {
+		    instance = HINSTANCE_16( hInst );
+	    }
 
             segptr = MapLS( info.data );
             hwndCtrl = WIN_Handle32( CreateWindowEx16( info.exStyle |
WS_EX_NOPARENTNOTIFY,
@@ -722,8 +722,10 @@
 
     if (template.menuName)
     {
-        if (!win32Template) dlgInfo->hMenu = LoadMenu16( hInst,
template.menuName );
-        else dlgInfo->hMenu = LoadMenuW( hInst,
(LPCWSTR)template.menuName );
+        if (!win32Template)
+		dlgInfo->hMenu = HMENU_32( LoadMenu16( HMENU_16( hInst ),
template.menuName ));
+        else
+		dlgInfo->hMenu = LoadMenuW( hInst, (LPCWSTR)template.menuName );
     }
 
       /* Create custom font if needed */
@@ -810,10 +812,13 @@
     }
 
     if (!win32Template)
-        hwnd = WIN_Handle32( CreateWindowEx16(template.exStyle,
template.className,
-                                              template.caption,
template.style & ~WS_VISIBLE,
-                                              rect.left, rect.top,
rect.right, rect.bottom,
-                                              HWND_16(owner),
dlgInfo->hMenu, hInst, NULL ));
+        hwnd = WIN_Handle32( CreateWindowEx16( template.exStyle,
template.className,
+					       template.caption, template.style & ~WS_VISIBLE,
+					       rect.left, rect.top, rect.right, rect.bottom,
+					       HWND_16( owner ),
+					       HMENU_16( dlgInfo->hMenu ),
+					       HINSTANCE_16( hInst ),
+					       NULL ));
     else
         hwnd = CreateWindowExW(template.exStyle,
(LPCWSTR)template.className,
                                  (LPCWSTR)template.caption,
@@ -973,8 +978,8 @@
                                            HWND16 owner, DLGPROC16
dlgProc,
                                            LPARAM param )
 {
-    return HWND_16( DIALOG_CreateIndirect( hInst, dlgTemplate,
WIN_Handle32(owner),
-                                                (DLGPROC)dlgProc,
param, WIN_PROC_16, FALSE ));
+    return HWND_16( DIALOG_CreateIndirect( HINSTANCE_32( hInst ),
dlgTemplate, WIN_Handle32(owner),
+					   (DLGPROC)dlgProc, param, WIN_PROC_16, FALSE ));
 }
 
 
@@ -982,9 +987,9 @@
  *		CreateDialogIndirectParamA (USER32.@)
  */
 HWND WINAPI CreateDialogIndirectParamA( HINSTANCE hInst,
-                                            LPCDLGTEMPLATEA
dlgTemplate,
-                                            HWND owner, DLGPROC
dlgProc,
-                                            LPARAM param )
+					LPCDLGTEMPLATEA dlgTemplate,
+					HWND owner, DLGPROC dlgProc,
+					LPARAM param )
 {
     return DIALOG_CreateIndirect( hInst, dlgTemplate, owner, dlgProc,
param, WIN_PROC_32A, FALSE );
 }
@@ -993,9 +998,9 @@
  *		CreateDialogIndirectParamAorW (USER32.@)
  */
 HWND WINAPI CreateDialogIndirectParamAorW( HINSTANCE hInst,
-                                            LPCVOID dlgTemplate,
-                                            HWND owner, DLGPROC
dlgProc,
-                                            LPARAM param )
+					   LPCVOID dlgTemplate,
+					   HWND owner, DLGPROC dlgProc,
+					   LPARAM param )
 {   FIXME("assume WIN_PROC_32W\n");
     return DIALOG_CreateIndirect( hInst, dlgTemplate, owner, dlgProc,
param, WIN_PROC_32W, FALSE );
 }
@@ -1004,9 +1009,9 @@
  *		CreateDialogIndirectParamW (USER32.@)
  */
 HWND WINAPI CreateDialogIndirectParamW( HINSTANCE hInst,
-                                            LPCDLGTEMPLATEW
dlgTemplate,
-                                            HWND owner, DLGPROC
dlgProc,
-                                            LPARAM param )
+					LPCDLGTEMPLATEW dlgTemplate,
+					HWND owner, DLGPROC dlgProc,
+					LPARAM param )
 {
     return DIALOG_CreateIndirect( hInst, dlgTemplate, owner, dlgProc,
param, WIN_PROC_32W, FALSE );
 }
@@ -1083,7 +1088,7 @@
     if ((data = LockResource16( hmem )))
     {
         HWND owner = WIN_Handle32(owner16);
-        hwnd = DIALOG_CreateIndirect( hInst, data, owner,
+        hwnd = DIALOG_CreateIndirect( HINSTANCE_32( hInst ), data,
owner,
                                       (DLGPROC)dlgProc, param,
WIN_PROC_16, TRUE );
         if (hwnd) ret = DIALOG_DoDialogBox( hwnd, owner );
         GlobalUnlock16( hmem );
@@ -1146,7 +1151,7 @@
     LPCVOID ptr;
 
     if (!(ptr = GlobalLock16( dlgTemplate ))) return -1;
-    hwnd = DIALOG_CreateIndirect( hInst, ptr, owner, (DLGPROC)dlgProc,
+    hwnd = DIALOG_CreateIndirect( HINSTANCE_32( hInst ), ptr, owner,
(DLGPROC)dlgProc,
                                   param, WIN_PROC_16, TRUE );
     GlobalUnlock16( dlgTemplate );
     if (hwnd) return DIALOG_DoDialogBox( hwnd, owner );
@@ -1189,7 +1194,7 @@
                                        LPARAM param, DWORD x )
 {
     HWND hwnd;
-    FIXME("0x%08x %p 0x%08x %p 0x%08lx 0x%08lx\n",
+    FIXME("%p %p %p %p 0x%08lx 0x%08lx\n",
       hInstance, template, owner, dlgProc, param, x);
     hwnd = DIALOG_CreateIndirect( hInstance, template, owner, dlgProc,
param, WIN_PROC_32W, TRUE );
     if (hwnd) return DIALOG_DoDialogBox( hwnd, owner );
@@ -1205,11 +1210,11 @@
     DIALOGINFO * dlgInfo;
     HWND owner;
 
-    TRACE("%04x %d\n", hwnd, retval );
+    TRACE("%p %d\n", hwnd, retval );
 
     if (!(dlgInfo = DIALOG_get_info( hwnd )))
     {
-        ERR("got invalid window handle (%04x); buggy app !?\n", hwnd);
+        ERR("got invalid window handle (%p); buggy app !?\n", hwnd);
         return FALSE;
     }
     dlgInfo->idResult = retval;
@@ -1821,7 +1826,7 @@
     BOOL ret;
     HWND listbox = GetDlgItem( hwnd, id );
 
-    TRACE("%04x '%s' %d\n", hwnd, str, id );
+    TRACE("%p '%s' %d\n", hwnd, str, id );
     if (!listbox) return FALSE;
 
     item = SendMessageA(listbox, combo ? CB_GETCURSEL : LB_GETCURSEL,
0, 0 );
@@ -1876,7 +1881,7 @@
     ((attrib & DDL_POSTMSGS) ? PostMessageA( hwnd, msg, wparam, lparam
) \
                              : SendMessageA( hwnd, msg, wparam, lparam
))
 
-    TRACE("%04x '%s' %d %d %04x\n",
+    TRACE("%p '%s' %d %d %04x\n",
                     hDlg, spec ? spec : "NULL", idLBox, idStatic,
attrib );
 
     /* If the path exists and is a directory, chdir to it */
Index: windows/input.c
===================================================================
RCS file: /home/wine/wine/windows/input.c,v
retrieving revision 1.84
diff -u -u -r1.84 input.c
--- windows/input.c	18 Nov 2002 19:47:20 -0000	1.84
+++ windows/input.c	22 Nov 2002 20:43:43 -0000
@@ -753,7 +753,7 @@
  */
 INT WINAPI GetKeyboardLayoutNameA(LPSTR pwszKLID)
 {
-        sprintf(pwszKLID, "%08x",GetKeyboardLayout(0));
+        sprintf(pwszKLID, "%p",GetKeyboardLayout(0));
         return 1;
 }
 
@@ -844,7 +844,7 @@
  */
 HKL WINAPI ActivateKeyboardLayout(HKL hLayout, UINT flags)
 {
-    TRACE_(keyboard)("(%d, %d)\n", hLayout, flags);
+    TRACE_(keyboard)("(%p, %d)\n", hLayout, flags);
     ERR_(keyboard)("Only default system keyboard layout supported. Call
ignored.\n");
     return 0;
 }
@@ -875,7 +875,7 @@
  *		RegisterHotKey (USER32.@)
  */
 BOOL WINAPI RegisterHotKey(HWND hwnd,INT id,UINT modifiers,UINT vk) {
-	FIXME_(keyboard)("(0x%08x,%d,0x%08x,%d):
stub\n",hwnd,id,modifiers,vk);
+	FIXME_(keyboard)("(%p,%d,0x%08x,%d): stub\n",hwnd,id,modifiers,vk);
 	return TRUE;
 }
 
@@ -883,7 +883,7 @@
  *		UnregisterHotKey (USER32.@)
  */
 BOOL WINAPI UnregisterHotKey(HWND hwnd,INT id) {
-	FIXME_(keyboard)("(0x%08x,%d): stub\n",hwnd,id);
+	FIXME_(keyboard)("(%p,%d): stub\n",hwnd,id);
 	return TRUE;
 }
 
@@ -1030,7 +1030,7 @@
     pos.x = 0;
     pos.y = 0;
 
-    TRACE("%lx, %lx, %x, %lx\n", ptme->cbSize, ptme->dwFlags,
ptme->hwndTrack, ptme->dwHoverTime);
+    TRACE("%lx, %lx, %p, %lx\n", ptme->cbSize, ptme->dwFlags,
ptme->hwndTrack, ptme->dwHoverTime);
 
     if (ptme->cbSize != sizeof(TRACKMOUSEEVENT)) {
         WARN("wrong TRACKMOUSEEVENT size from app\n");
Index: windows/mdi.c
===================================================================
RCS file: /home/wine/wine/windows/mdi.c,v
retrieving revision 1.104
diff -u -u -r1.104 mdi.c
--- windows/mdi.c	22 Nov 2002 04:47:10 -0000	1.104
+++ windows/mdi.c	22 Nov 2002 20:43:44 -0000
@@ -198,10 +198,10 @@
     {
         if (win == WND_OTHER_PROCESS)
         {
-            ERR( "client %x belongs to other process\n", client );
+            ERR( "client %p belongs to other process\n", client );
             return NULL;
         }
-        if (win->cbWndExtra < sizeof(MDICLIENTINFO)) WARN( "%x is not
an MDI client\n", client );
+        if (win->cbWndExtra < sizeof(MDICLIENTINFO)) WARN( "%p is not
an MDI client\n", client );
         else ret = (MDICLIENTINFO *)win->wExtra;
         WIN_ReleasePtr( win );
     }
@@ -358,7 +358,7 @@
     HWND hwndFrame = GetParent(hwnd);
     HMENU oldFrameMenu = GetMenu(hwndFrame);
 
-    TRACE("%04x %04x %04x\n",
+    TRACE("%p %p %p\n",
                 hwnd, hmenuFrame, hmenuWindow);
 
     if (hmenuFrame && !IsMenu(hmenuFrame))
@@ -472,8 +472,8 @@
     HWND hwndFrame = GetParent(hwnd);
     HMENU oldFrameMenu = GetMenu(hwndFrame);
 
-    TRACE("%04x %04x %04x\n",
-                hwnd, hmenuFrame, hmenuWindow);
+    TRACE("%p %p %p\n",
+	  hwnd, hmenuFrame, hmenuWindow);
 
     FIXME("partially function stub\n");
 
@@ -514,7 +514,7 @@
     /* restore current maximized child */
     if( (style & WS_VISIBLE) && ci->hwndChildMaximized )
     {
-	TRACE("Restoring current maximized child %04x\n",
ci->hwndChildMaximized);
+	TRACE("Restoring current maximized child %p\n",
ci->hwndChildMaximized);
 	if( style & WS_MAXIMIZE )
 	    SendMessageW(parent, WM_SETREDRAW, FALSE, 0L);
 	hwndMax = ci->hwndChildMaximized;
@@ -607,7 +607,7 @@
 
         if( IsIconic(hwnd) && ci->hwndActiveChild )
 	{
-	    TRACE("Minimizing created MDI child %04x\n", hwnd);
+	    TRACE("Minimizing created MDI child %p\n", hwnd);
 	    ShowWindow( hwnd, SW_SHOWMINNOACTIVE );
 	}
 	else
@@ -619,7 +619,7 @@
              */
             if (IsWindowVisible(hwnd)) ShowWindow(hwnd, SW_SHOW);
 	}
-        TRACE("created child - %04x\n",hwnd);
+        TRACE("created child - %p\n",hwnd);
     }
     else
     {
@@ -671,7 +671,7 @@
 
     hwndTo = MDI_GetWindow(ci, childHwnd, bNextWindow, 0);
 
-    TRACE("from %04x, to %04x\n",childHwnd,hwndTo);
+    TRACE("from %p, to %p\n",childHwnd,hwndTo);
 
     if ( !hwndTo ) return; /* no window to switch to */
 
@@ -718,7 +718,7 @@
 
     ci->nActiveChildren--;
 
-    TRACE("child destroyed - %04x\n",child);
+    TRACE("child destroyed - %p\n",child);
 
     if (flagDestroy)
     {
@@ -746,7 +746,7 @@
        since ShowWindow DOES activate MDI children */
     if (clientInfo->hwndActiveChild == child) return 0;
 
-    TRACE("%04x\n", child);
+    TRACE("%p\n", child);
 
     isActiveFrameWnd = (GetActiveWindow() == GetParent(client));
 
@@ -897,7 +897,7 @@
         /* walk the list (backwards) and move windows */
         for (i = total - 1; i >= 0; i--)
         {
-            TRACE("move %04x to (%ld,%ld) size [%ld,%ld]\n",
+            TRACE("move %p to (%ld,%ld) size [%ld,%ld]\n",
                   win_array[i], pos[0].x, pos[0].y, pos[1].x,
pos[1].y);
 
             MDI_CalcDefaultChildPos(client, n++, pos, delta);
@@ -1007,7 +1007,7 @@
     HMENU  	hSysPopup = 0;
   HBITMAP hSysMenuBitmap = 0;
 
-    TRACE("frame %04x,child %04x\n",frame,hChild);
+    TRACE("frame %p,child %p\n",frame,hChild);
 
     if( !menu || !child->hSysMenu )
     {
@@ -1098,7 +1098,7 @@
     INT nItems = GetMenuItemCount(menu) - 1;
     UINT iId = GetMenuItemID(menu,nItems) ;
 
-    TRACE("frame %04x,child
%04x,nIt=%d,iId=%d\n",frame,hChild,nItems,iId);
+    TRACE("frame %p,child %p,nIt=%d,iId=%d\n",frame,hChild,nItems,iId);
 
     if(!(iId == SC_RESTORE || iId == SC_CLOSE) )
 	return 0;
@@ -1118,11 +1118,11 @@
 
     RemoveMenu(menu,0,MF_BYPOSITION);
 
-    if ( (menuInfo.fType & MFT_BITMAP)           &&
-	 (LOWORD(menuInfo.dwTypeData)!=0)        &&
-	 (LOWORD(menuInfo.dwTypeData)!=hBmpClose) )
+    if ( (menuInfo.fType & MFT_BITMAP)            &&
+	 (HBITMAP_16( menuInfo.dwTypeData ) != 0) &&
+	 (HBITMAP_32( menuInfo.dwTypeData ) != hBmpClose) )
     {
-      DeleteObject((HBITMAP)LOWORD(menuInfo.dwTypeData));
+      DeleteObject(HBITMAP_32( menuInfo.dwTypeData ));
     }
 
     if(TWEAK_WineLook > WIN31_LOOK)
@@ -1245,7 +1245,7 @@
         else
 	{
 	    LPCLIENTCREATESTRUCT16 ccs = MapSL((SEGPTR)cs->lpCreateParams);
-	    ci->hWindowMenu	= ccs->hWindowMenu;
+	    ci->hWindowMenu	= HMENU_32( ccs->hWindowMenu);
 	    ci->idFirstChild	= ccs->idFirstChild;
 	}
         WIN_ReleasePtr( wndPtr );
@@ -1267,7 +1267,7 @@
 
         MDI_UpdateFrameText( GetParent(hwnd), hwnd, MDI_NOFRAMEREPAINT,
NULL);
 
-	TRACE("Client created - hwnd = %04x, idFirst = %u\n",
+	TRACE("Client created - hwnd = %p, idFirst = %u\n",
               hwnd, ci->idFirstChild );
         return 0;
       }
@@ -1367,7 +1367,7 @@
             pt.y = SHIWORD(lParam);
             child = ChildWindowFromPoint(hwnd, pt);
 
-	    TRACE("notification from %04x (%li,%li)\n",child,pt.x,pt.y);
+	    TRACE("notification from %p (%li,%li)\n",child,pt.x,pt.y);
 
             if( child && child != hwnd && child != ci->hwndActiveChild
)
                 SetWindowPos(child, 0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE
);
@@ -1751,7 +1751,7 @@
                 ShowWindow( hMaxChild, SW_SHOWNOACTIVATE );
                 SendMessageW( hMaxChild, WM_SETREDRAW, TRUE, 0 );
             }
-            TRACE("maximizing child %04x\n", hwnd );
+            TRACE("maximizing child %p\n", hwnd );
 
             /* keep track of the maximized window. */
             ci->hwndChildMaximized = hwnd; /* !!! */
@@ -1823,13 +1823,13 @@
     MDICLIENTINFO *pCi = get_client_info( hWndParent );
     MDICREATESTRUCTA cs;
 
-    TRACE("(%s,%s,%ld,%d,%d,%d,%d,%x,%d,%ld)\n",
+    TRACE("(%s,%s,%ld,%d,%d,%d,%d,%p,%p,%ld)\n",
           debugstr_a(lpClassName),debugstr_a(lpWindowName),dwStyle,X,Y,
           nWidth,nHeight,hWndParent,hInstance,lParam);
 
     if (!pCi)
     {
-        ERR("bad hwnd for MDI-client: %04x\n", hWndParent);
+        ERR("bad hwnd for MDI-client: %p\n", hWndParent);
         return 0;
     }
     cs.szClass=lpClassName;
@@ -1867,13 +1867,13 @@
     MDICLIENTINFO *pCi = get_client_info( hWndParent );
     MDICREATESTRUCTW cs;
 
-    TRACE("(%s,%s,%ld,%d,%d,%d,%d,%x,%d,%ld)\n",
+    TRACE("(%s,%s,%ld,%d,%d,%d,%d,%p,%p,%ld)\n",
           debugstr_w(lpClassName), debugstr_w(lpWindowName), dwStyle,
X, Y,
           nWidth, nHeight, hWndParent, hInstance, lParam);
 
     if (!pCi)
     {
-        ERR("bad hwnd for MDI-client: %04x\n", hWndParent);
+        ERR("bad hwnd for MDI-client: %p\n", hWndParent);
         return 0;
     }
     cs.szClass = lpClassName;
@@ -2077,7 +2077,7 @@
 CascadeWindows (HWND hwndParent, UINT wFlags, const LPRECT lpRect,
 		UINT cKids, const HWND *lpKids)
 {
-    FIXME("(0x%08x,0x%08x,...,%u,...): stub\n",
+    FIXME("(%p,0x%08x,...,%u,...): stub\n",
 	   hwndParent, wFlags, cKids);
 
     return 0;
@@ -2095,7 +2095,7 @@
 TileWindows (HWND hwndParent, UINT wFlags, const LPRECT lpRect,
 	     UINT cKids, const HWND *lpKids)
 {
-    FIXME("(0x%08x,0x%08x,...,%u,...): stub\n",
+    FIXME("(%p,0x%08x,...,%u,...): stub\n",
 	   hwndParent, wFlags, cKids);
 
     return 0;
Index: windows/message.c
===================================================================
RCS file: /home/wine/wine/windows/message.c,v
retrieving revision 1.148
diff -u -u -r1.148 message.c
--- windows/message.c	30 Oct 2002 23:45:38 -0000	1.148
+++ windows/message.c	22 Nov 2002 20:43:45 -0000
@@ -793,7 +793,7 @@
     start_time = GetTickCount();
     elapsed = 0;
 
-    TRACE("waiting for %x\n", idle_event );
+    TRACE("waiting for %p\n", idle_event );
     do
     {
         ret = MsgWaitForMultipleObjects ( 1, &idle_event, FALSE,
dwTimeOut - elapsed, QS_SENDMESSAGE );
@@ -1077,7 +1077,7 @@
     if (wndPtr == WND_OTHER_PROCESS)
     {
         if (IsWindow( msg->hwnd ))
-            ERR( "cannot dispatch msg to other process window %x\n",
msg->hwnd );
+            ERR( "cannot dispatch msg to other process window %p\n",
msg->hwnd );
         SetLastError( ERROR_INVALID_WINDOW_HANDLE );
         return 0;
     }
@@ -1105,7 +1105,7 @@
         WIN_ReleasePtr( wndPtr );
         if (validate)
         {
-            ERR( "BeginPaint not called on WM_PAINT for hwnd %04x!\n",
msg->hwnd );
+            ERR( "BeginPaint not called on WM_PAINT for hwnd %p!\n",
msg->hwnd );
             /* Validate the update region to avoid infinite WM_PAINT
loop */
             RedrawWindow( msg->hwnd, NULL, 0,
                           RDW_NOFRAME | RDW_VALIDATE | RDW_NOCHILDREN |
RDW_NOINTERNALPAINT );
@@ -1169,7 +1169,7 @@
     if (wndPtr == WND_OTHER_PROCESS)
     {
         if (IsWindow( msg->hwnd ))
-            ERR( "cannot dispatch msg to other process window %x\n",
msg->hwnd );
+            ERR( "cannot dispatch msg to other process window %p\n",
msg->hwnd );
         SetLastError( ERROR_INVALID_WINDOW_HANDLE );
         return 0;
     }
@@ -1197,7 +1197,7 @@
         WIN_ReleasePtr( wndPtr );
         if (validate)
         {
-            ERR( "BeginPaint not called on WM_PAINT for hwnd %04x!\n",
msg->hwnd );
+            ERR( "BeginPaint not called on WM_PAINT for hwnd %p!\n",
msg->hwnd );
             /* Validate the update region to avoid infinite WM_PAINT
loop */
             RedrawWindow( msg->hwnd, NULL, 0,
                           RDW_NOFRAME | RDW_VALIDATE | RDW_NOCHILDREN |
RDW_NOINTERNALPAINT );
Index: windows/nonclient.c
===================================================================
RCS file: /home/wine/wine/windows/nonclient.c,v
retrieving revision 1.104
diff -u -u -r1.104 nonclient.c
--- windows/nonclient.c	13 Nov 2002 19:43:53 -0000	1.104
+++ windows/nonclient.c	22 Nov 2002 20:43:46 -0000
@@ -296,7 +296,7 @@
 {
     RECT   rc = *rect;
 
-    TRACE("(%08x,%08x,%p,%08x,%08x,%s,%08x)\n",
+    TRACE("(%p,%p,%p,%p,%p,%s,%08x)\n",
           hwnd, hdc, rect, hFont, hIcon, debugstr_w(str), uFlags);
 
     /* drawing background */
@@ -469,7 +469,7 @@
 
         if (!(style & WS_CHILD) && GetMenu(hwnd))
         {
-	    TRACE("Calling GetMenuBarHeight with HWND 0x%x, width %d, "
+	    TRACE("Calling GetMenuBarHeight with HWND %p, width %d, "
                   "at (%d, %d).\n", hwnd,
                   winRect->right - winRect->left,
                   -tmpRect.left, -tmpRect.top );
@@ -563,7 +563,7 @@
 {
     RECT rect;
 
-    TRACE("hwnd=%04x pt=%ld,%ld\n", wndPtr->hwndSelf, pt.x, pt.y );
+    TRACE("hwnd=%p pt=%ld,%ld\n", wndPtr->hwndSelf, pt.x, pt.y );
 
     GetWindowRect(wndPtr->hwndSelf, &rect );
     if (!PtInRect( &rect, pt )) return HTNOWHERE;
@@ -695,7 +695,7 @@
 {
     RECT rect;
 
-    TRACE("hwnd=%04x pt=%ld,%ld\n", wndPtr->hwndSelf, pt.x, pt.y );
+    TRACE("hwnd=%p pt=%ld,%ld\n", wndPtr->hwndSelf, pt.x, pt.y );
 
     GetWindowRect(wndPtr->hwndSelf, &rect );
     if (!PtInRect( &rect, pt )) return HTNOWHERE;
@@ -1408,7 +1408,7 @@
 
     active  = flags & WIN_NCACTIVATED;
 
-    TRACE("%04x %d\n", hwnd, active );
+    TRACE("%p %d\n", hwnd, active );
 
     if (!(hdc = GetDCEx( hwnd, (clip > (HRGN)1) ? clip : 0,
DCX_USESTYLE | DCX_WINDOW |
 			      ((clip > (HRGN)1) ? (DCX_INTERSECTRGN | DCX_KEEPCLIPRGN): 0)
))) return;
@@ -1533,7 +1533,7 @@
 
     active  = flags & WIN_NCACTIVATED;
 
-    TRACE("%04x %d\n", hwnd, active );
+    TRACE("%p %d\n", hwnd, active );
 
     /* MSDN docs are pretty idiotic here, they say app CAN use clipRgn
in
        the call to GetDCEx implying that it is allowed not to use it
either.
Index: windows/painting.c
===================================================================
RCS file: /home/wine/wine/windows/painting.c,v
retrieving revision 1.78
diff -u -u -r1.78 painting.c
--- windows/painting.c	30 Oct 2002 23:45:38 -0000	1.78
+++ windows/painting.c	22 Nov 2002 20:43:47 -0000
@@ -205,7 +205,7 @@
     HRGN  hClip = 0;
     HRGN  hrgnRet = 0;
 
-    TRACE_(nonclient)("hwnd %04x [%04x] hrgn %04x, unc %04x, ncf %i\n",
+    TRACE_(nonclient)("hwnd %p [%p] hrgn %p, unc %04x, ncf %i\n",
                       wnd->hwndSelf, wnd->hrgnUpdate, hRgn, uncFlags,
wnd->flags & WIN_NEEDS_NCPAINT);
 
     /* desktop window doesn't have a nonclient area */
@@ -243,7 +243,7 @@
 	    wnd->flags &= ~WIN_NEEDS_NCPAINT;
 	    GETCLIENTRECTW( wnd, r );
 
-	    TRACE_(nonclient)( "\tclient box (%i,%i-%i,%i), hrgnUpdate
%04x\n",
+	    TRACE_(nonclient)( "\tclient box (%i,%i-%i,%i), hrgnUpdate %p\n",
 				r.left, r.top, r.right, r.bottom, wnd->hrgnUpdate );
 	    if( wnd->hrgnUpdate > (HRGN)1 )
 	    {
@@ -337,7 +337,7 @@
         }
     }
 
-    TRACE_(nonclient)("returning %04x (hClip = %04x, hrgnUpdate =
%04x)\n", hrgnRet, hClip, wnd->hrgnUpdate );
+    TRACE_(nonclient)("returning %p (hClip = %p, hrgnUpdate = %p)\n",
hrgnRet, hClip, wnd->hrgnUpdate );
 
     return hrgnRet;
 }
@@ -427,7 +427,7 @@
     r.right = wndPtr->rectWindow.right - wndPtr->rectWindow.left;
     r.bottom = wndPtr->rectWindow.bottom - wndPtr->rectWindow.top;
 
-    TRACE("\thwnd %04x [%04x] -> hrgn [%04x], flags [%04x]\n",
wndPtr->hwndSelf, wndPtr->hrgnUpdate, hRgn, flags );
+    TRACE("\thwnd %p [%p] -> hrgn [%p], flags [%04x]\n",
wndPtr->hwndSelf, wndPtr->hrgnUpdate, hRgn, flags );
 
     if( flags & RDW_INVALIDATE )
     {
@@ -630,7 +630,7 @@
 
       /* Erase/update the window itself ... */
 
-    TRACE("\thwnd %04x [%04x] -> hrgn [%04x], flags [%04x]\n", hWnd,
wndPtr->hrgnUpdate, hrgn, flags );
+    TRACE("\thwnd %p [%p] -> hrgn [%p], flags [%04x]\n", hWnd,
wndPtr->hrgnUpdate, hrgn, flags );
 
     /*
      * Check if this window should delay it's processing of WM_NCPAINT.
@@ -731,7 +731,7 @@
 	if( hrgnUpdate )
 	{
 	    GetRgnBox( hrgnUpdate, &r );
-            TRACE( "%04x (%04x) NULL %04x box (%i,%i-%i,%i)
flags=%04x\n",
+            TRACE( "%p (%p) NULL %p box (%i,%i-%i,%i) flags=%04x\n",
 	          hwnd, wndPtr->hrgnUpdate, hrgnUpdate, r.left, r.top,
r.right, r.bottom, flags );
 	}
 	else
@@ -740,7 +740,7 @@
 		r = *rectUpdate;
 	    else
 		SetRectEmpty( &r );
-	    TRACE( "%04x (%04x) %s %d,%d-%d,%d %04x flags=%04x\n",
+	    TRACE( "%p (%p) %s %d,%d-%d,%d %p flags=%04x\n",
 			hwnd, wndPtr->hrgnUpdate, rectUpdate ? "rect" : "NULL", r.left,
 			r.top, r.right, r.bottom, hrgnUpdate, flags );
 	}
@@ -1157,7 +1157,7 @@
                                    const RECT* lprcFrom,
                                    const RECT* lprcTo )
 {
-    FIXME_(win)("(0x%x,%d,%p,%p): stub\n",hwnd,idAni,lprcFrom,lprcTo);
+    FIXME_(win)("(%p,%d,%p,%p): stub\n",hwnd,idAni,lprcFrom,lprcTo);
     return TRUE;
 }
 
Index: windows/spy.c
===================================================================
RCS file: /home/wine/wine/windows/spy.c,v
retrieving revision 1.47
diff -u -u -r1.47 spy.c
--- windows/spy.c	28 Oct 2002 19:04:39 -0000	1.47
+++ windows/spy.c	22 Nov 2002 20:43:48 -0000
@@ -2149,7 +2149,7 @@
 		      lpdis->CtlType, lpdis->CtlID);
 		TRACE("itemID=0x%08x itemAction=0x%08x itemState=0x%08x\n",
 		      lpdis->itemID, lpdis->itemAction, lpdis->itemState);
-		TRACE("hWnd=0x%04x hDC=0x%04x (%d,%d)-(%d,%d) itemData=0x%08lx\n",
+		TRACE("hWnd=%p hDC=%p (%d,%d)-(%d,%d) itemData=0x%08lx\n",
 		      lpdis->hwndItem, lpdis->hDC, lpdis->rcItem.left,
 		      lpdis->rcItem.top, lpdis->rcItem.right,
 		      lpdis->rcItem.bottom, lpdis->itemData);
@@ -2170,7 +2170,7 @@
 	case WM_WINDOWPOSCHANGING:
 	    {
 		WINDOWPOS *lpwp = (WINDOWPOS *)sp_e->lParam;
-		TRACE("WINDOWPOS hwnd=0x%04x, after=0x%04x, at (%d,%d) w=%d h=%d,
flags=0x%08x\n",
+		TRACE("WINDOWPOS hwnd=%p, after=%p, at (%d,%d) w=%d h=%d,
flags=0x%08x\n",
 		      lpwp->hwnd, lpwp->hwndInsertAfter, lpwp->x, lpwp->y,
 		      lpwp->cx, lpwp->cy, lpwp->flags);
 	    }
@@ -2203,7 +2203,7 @@
 		p = SPY_Bsearch_Notify (&spnfy_array[0], end_spnfy_array,
 					pnmh->code);
 		if (p) {
-		    TRACE("NMHDR hwndFrom=0x%08x idFrom=0x%08x code=%s<0x%08x>,
extra=0x%x\n",
+		    TRACE("NMHDR hwndFrom=%p idFrom=0x%08x code=%s<0x%08x>,
extra=0x%x\n",
 			  pnmh->hwndFrom, pnmh->idFrom, p->name, pnmh->code, p->len);
 		    dumplen = p->len;
 
@@ -2223,7 +2223,7 @@
 		    }
 		}
 		else
-		    TRACE("NMHDR hwndFrom=0x%08x idFrom=0x%08x code=0x%08x\n",
+		    TRACE("NMHDR hwndFrom=%p idFrom=0x%08x code=0x%08x\n",
 			  pnmh->hwndFrom, pnmh->idFrom, pnmh->code);
 	    }
 	default:
@@ -2262,9 +2262,9 @@
         break;
 
     case SPY_DISPATCHMESSAGE:
-        TRACE("%*s(%08x) %-16s message [%04x] %s dispatched  wp=%08x
lp=%08lx\n",
-                        indent, "", hWnd, debugstr_w(sp_e.wnd_name),
msg,
-                        sp_e.msg_name, wParam, lParam);
+        TRACE("%*s(%p) %-16s message [%04x] %s dispatched  wp=%08x
lp=%08lx\n",
+	      indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
+	      sp_e.msg_name, wParam, lParam);
         break;
 
     case SPY_SENDMESSAGE16:
@@ -2281,9 +2281,9 @@
                       indent, "", HWND_16(hWnd),
debugstr_w(sp_e.wnd_name), msg,
                       sp_e.msg_name, taskName, wParam, lParam );
             else
-            {   TRACE("%*s(%08x) %-16s message [%04x] %s sent from %s
wp=%08x lp=%08lx\n",
-			     indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
-			     sp_e.msg_name, taskName, wParam, lParam );
+            {   TRACE("%*s(%p) %-16s message [%04x] %s sent from %s
wp=%08x lp=%08lx\n",
+		      indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
+		      sp_e.msg_name, taskName, wParam, lParam );
 		SPY_DumpStructure(&sp_e, TRUE);
 	    }
         }
@@ -2297,7 +2297,7 @@
 
     case SPY_DEFWNDPROC:
 	if( SPY_ExcludeDWP ) return;
-        TRACE("%*s(%08x)  DefWindowProc32: %s [%04x]  wp=%08x
lp=%08lx\n",
+        TRACE("%*s(%p)  DefWindowProc32: %s [%04x]  wp=%08x
lp=%08lx\n",
                         indent, "", hWnd, sp_e.msg_name,
                         msg, wParam, lParam );
         break;
@@ -2340,8 +2340,8 @@
 	break;
 
     case SPY_RESULT_DEFWND:
-	TRACE(" %*s(%08x)  DefWindowProc32: %s [%04x] returned %08lx\n",
-			indent, "", hWnd, sp_e.msg_name, msg, lReturn );
+	TRACE(" %*s(%p)  DefWindowProc32: %s [%04x] returned %08lx\n",
+	      indent, "", hWnd, sp_e.msg_name, msg, lReturn );
 	break;
 
     case SPY_RESULT_OK16:
@@ -2351,9 +2351,9 @@
         break;
 
     case SPY_RESULT_OK:
-        TRACE(" %*s(%08x) %-16s message [%04x] %s returned %08lx\n",
-                        indent, "", hWnd, debugstr_w(sp_e.wnd_name),
msg,
-                        sp_e.msg_name, lReturn );
+        TRACE(" %*s(%p) %-16s message [%04x] %s returned %08lx\n",
+	      indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
+	      sp_e.msg_name, lReturn );
 	SPY_DumpStructure(&sp_e, FALSE);
         break;
 
@@ -2363,9 +2363,9 @@
         break;
 
     case SPY_RESULT_INVALIDHWND:
-        WARN(" %*s(%08x) %-16s message [%04x] %s HAS INVALID HWND\n",
-                        indent, "", hWnd, debugstr_w(sp_e.wnd_name),
msg,
-                        sp_e.msg_name );
+        WARN(" %*s(%p) %-16s message [%04x] %s HAS INVALID HWND\n",
+	     indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
+	     sp_e.msg_name );
         break;
    }
 }
Index: windows/struct32.c
===================================================================
RCS file: /home/wine/wine/windows/struct32.c,v
retrieving revision 1.6
diff -u -u -r1.6 struct32.c
--- windows/struct32.c	17 Oct 2002 16:43:42 -0000	1.6
+++ windows/struct32.c	22 Nov 2002 20:43:48 -0000
@@ -23,26 +23,26 @@
 #include "win.h"
 #include "winerror.h"
 
-void STRUCT32_MSG16to32(const MSG16 *msg16,MSG *msg32)
+void STRUCT32_MSG16to32( const MSG16 *msg16, MSG *msg32 )
 {
-	msg32->hwnd = WIN_Handle32(msg16->hwnd);
-	msg32->message=msg16->message;
-	msg32->wParam=msg16->wParam;
-	msg32->lParam=msg16->lParam;
-	msg32->time=msg16->time;
-	msg32->pt.x=msg16->pt.x;
-	msg32->pt.y=msg16->pt.y;
-}
-
-void STRUCT32_MSG32to16(const MSG *msg32,MSG16 *msg16)
-{
-	msg16->hwnd = HWND_16(msg32->hwnd);
-	msg16->message=msg32->message;
-	msg16->wParam=msg32->wParam;
-	msg16->lParam=msg32->lParam;
-	msg16->time=msg32->time;
-	msg16->pt.x=msg32->pt.x;
-	msg16->pt.y=msg32->pt.y;
+    msg32->hwnd    = HANDLE_32( msg16->hwnd );
+    msg32->message = msg16->message;
+    msg32->wParam  = msg16->wParam;
+    msg32->lParam  = msg16->lParam;
+    msg32->time    = msg16->time;
+    msg32->pt.x    = msg16->pt.x;
+    msg32->pt.y    = msg16->pt.y;
+}
+
+void STRUCT32_MSG32to16( const MSG *msg32, MSG16 *msg16 )
+{
+    msg16->hwnd    = HWND_16( msg32->hwnd );
+    msg16->message = msg32->message;
+    msg16->wParam  = msg32->wParam;
+    msg16->lParam  = msg32->lParam;
+    msg16->time    = msg32->time;
+    msg16->pt.x    = msg32->pt.x;
+    msg16->pt.y    = msg32->pt.y;
 }
 
 void STRUCT32_MINMAXINFO32to16( const MINMAXINFO *from, MINMAXINFO16
*to )
@@ -65,8 +65,8 @@
 
 void STRUCT32_WINDOWPOS32to16( const WINDOWPOS* from, WINDOWPOS16* to )
 {
-    to->hwnd            = HWND_16(from->hwnd);
-    to->hwndInsertAfter = HWND_16(from->hwndInsertAfter);
+    to->hwnd            = HWND_16( from->hwnd );
+    to->hwndInsertAfter = HWND_16( from->hwndInsertAfter );
     to->x               = from->x;
     to->y               = from->y;
     to->cx              = from->cx;
@@ -76,9 +76,9 @@
 
 void STRUCT32_WINDOWPOS16to32( const WINDOWPOS16* from, WINDOWPOS* to )
 {
-    to->hwnd            = WIN_Handle32(from->hwnd);
+    to->hwnd            = HANDLE_32( from->hwnd );
     to->hwndInsertAfter = (from->hwndInsertAfter == (HWND16)-1) ?
-                           HWND_TOPMOST :
WIN_Handle32(from->hwndInsertAfter);
+                           HWND_TOPMOST : HANDLE_32(
from->hwndInsertAfter );
     to->x               = from->x;
     to->y               = from->y;
     to->cx              = from->cx;
@@ -91,9 +91,9 @@
                                    CREATESTRUCT16* to )
 {
     to->lpCreateParams = from->lpCreateParams;
-    to->hInstance      = (HINSTANCE16)from->hInstance;
-    to->hMenu          = (HMENU16)from->hMenu;
-    to->hwndParent     = HWND_16(from->hwndParent);
+    to->hInstance      = HINSTANCE_16( from->hInstance );
+    to->hMenu          = HMENU_16( from->hMenu );
+    to->hwndParent     = HWND_16( from->hwndParent );
     to->cy             = from->cy;
     to->cx             = from->cx;
     to->y              = from->y;
@@ -106,9 +106,9 @@
                                    CREATESTRUCTA *to )
 {
     to->lpCreateParams = from->lpCreateParams;
-    to->hInstance      = (HINSTANCE)from->hInstance;
-    to->hMenu          = (HMENU)from->hMenu;
-    to->hwndParent     = WIN_Handle32(from->hwndParent);
+    to->hInstance      = HINSTANCE_32( from->hInstance );
+    to->hMenu          = HMENU_32( from->hMenu );
+    to->hwndParent     = HANDLE_32( from->hwndParent );
     to->cy             = from->cy;
     to->cx             = from->cx;
     to->y              = from->y;
@@ -121,7 +121,7 @@
 void STRUCT32_MDICREATESTRUCT32Ato16( const MDICREATESTRUCTA* from,
                                       MDICREATESTRUCT16* to )
 {
-    to->hOwner = (HINSTANCE16)from->hOwner;
+    to->hOwner = HINSTANCE_16( from->hOwner );
     to->x      = from->x;
     to->y      = from->y;
     to->cx     = from->cx;
@@ -133,7 +133,7 @@
 void STRUCT32_MDICREATESTRUCT16to32A( const MDICREATESTRUCT16* from,
                                       MDICREATESTRUCTA *to )
 {
-    to->hOwner = (HINSTANCE)from->hOwner;
+    to->hOwner = HINSTANCE_32( from->hOwner );
     to->x      = from->x;
     to->y      = from->y;
     to->cx     = from->cx;
Index: windows/syscolor.c
===================================================================
RCS file: /home/wine/wine/windows/syscolor.c,v
retrieving revision 1.36
diff -u -u -r1.36 syscolor.c
--- windows/syscolor.c	22 Nov 2002 04:47:10 -0000	1.36
+++ windows/syscolor.c	22 Nov 2002 20:43:48 -0000
@@ -35,6 +35,7 @@
 #include "local.h"
 #include "user.h"
 #include "gdi.h" /* sic */
+#include "wownt32.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(syscolor);
 
@@ -131,14 +132,14 @@
     if (!heap_sel) heap_sel = LoadLibrary16( "gdi" );
     if (heap_sel >= 32)
     {
-        ptr = (LPWORD)LOCAL_Lock(heap_sel, handle);
+        ptr = (LPWORD)LOCAL_Lock(heap_sel, HGDIOBJ_16( handle ));
 
         /* touch the "system" bit of the wMagic field of a GDIOBJHDR */
         if (set)
             *(ptr+1) &= ~OBJECT_NOSYSTEM;
         else
             *(ptr+1) |= OBJECT_NOSYSTEM;
-        LOCAL_Unlock( heap_sel, handle );
+        LOCAL_Unlock( heap_sel, HGDIOBJ_16( handle ));
     }
 }
 
Index: windows/timer.c
===================================================================
RCS file: /home/wine/wine/windows/timer.c,v
retrieving revision 1.39
diff -u -u -r1.39 timer.c
--- windows/timer.c	31 Oct 2002 01:04:39 -0000	1.39
+++ windows/timer.c	22 Nov 2002 20:43:48 -0000
@@ -181,7 +181,7 @@
     pTimer->timeout = timeout;
     pTimer->proc    = winproc;
 
-    TRACE("Timer added: %p, %04x, %04x, %04x, %08lx\n",
+    TRACE("Timer added: %p, %p, %04x, %04x, %08lx\n",
 		   pTimer, pTimer->hwnd, pTimer->msg, pTimer->id,
                    (DWORD)pTimer->proc );
 
@@ -255,7 +255,7 @@
 UINT_PTR WINAPI SetTimer( HWND hwnd, UINT_PTR id, UINT timeout,
                           TIMERPROC proc )
 {
-    TRACE("%04x %d %d %08lx\n",
+    TRACE("%p %d %d %08lx\n",
                    hwnd, id, timeout, (LONG)proc );
     return TIMER_SetTimer( hwnd, id, timeout, (WNDPROC16)proc,
WIN_PROC_32A, FALSE );
 }
@@ -305,7 +305,7 @@
 UINT_PTR WINAPI SetSystemTimer( HWND hwnd, UINT_PTR id, UINT timeout,
                                 TIMERPROC proc )
 {
-    TRACE("%04x %d %d %08lx\n",
+    TRACE("%p %d %d %08lx\n",
                    hwnd, id, timeout, (LONG)proc );
     return TIMER_SetTimer( hwnd, id, timeout, (WNDPROC16)proc,
WIN_PROC_32A, TRUE );
 }
@@ -316,7 +316,7 @@
  */
 BOOL WINAPI KillTimer( HWND hwnd, UINT_PTR id )
 {
-    TRACE("%04x %d\n", hwnd, id );
+    TRACE("%p %d\n", hwnd, id );
     return TIMER_KillTimer( hwnd, id, FALSE );
 }
 
@@ -326,6 +326,6 @@
  */
 BOOL WINAPI KillSystemTimer( HWND hwnd, UINT_PTR id )
 {
-    TRACE("%04x %d\n", hwnd, id );
+    TRACE("%p %d\n", hwnd, id );
     return TIMER_KillTimer( hwnd, id, TRUE );
 }
Index: windows/user.c
===================================================================
RCS file: /home/wine/wine/windows/user.c,v
retrieving revision 1.90
diff -u -u -r1.90 user.c
--- windows/user.c	21 Nov 2002 00:02:09 -0000	1.90
+++ windows/user.c	22 Nov 2002 20:43:49 -0000
@@ -37,6 +37,7 @@
 #include "module.h"
 #include "winternl.h"
 #include "wine/debug.h"
+#include "wownt32.h"
 
 WINE_DECLARE_DEBUG_CHANNEL(hook);
 WINE_DECLARE_DEBUG_CHANNEL(local);
@@ -138,7 +139,7 @@
 {
     /* HOOK_FreeModuleHooks( hModule ); */
     CLASS_FreeModuleClasses( hModule );
-    CURSORICON_FreeModuleIcons( hModule );
+    CURSORICON_FreeModuleIcons( HMODULE_32( hModule ));
 }
 

/***********************************************************************
@@ -310,7 +311,7 @@
 	LPCSTR devname, LPDEVMODEA devmode, HWND hwnd, DWORD flags,
 	LPARAM lparam
 ) {
-  FIXME_(system)("(%s,%p,0x%04x,0x%08lx,0x%08lx),
stub\n",devname,devmode,hwnd,flags,lparam);
+  FIXME_(system)("(%s,%p,%p,0x%08lx,0x%08lx),
stub\n",devname,devmode,hwnd,flags,lparam);
   MESSAGE("\tflags=");_dump_CDS_flags(flags);MESSAGE("\n");
   if (devmode==NULL)
     FIXME_(system)("   devmode=NULL (return to default mode)\n");
@@ -518,7 +519,7 @@
  *		RegisterLogonProcess (USER32.@)
  */
 DWORD WINAPI RegisterLogonProcess(HANDLE hprocess,BOOL x) {
-	FIXME_(win32)("(%d,%d),stub!\n",hprocess,x);
+	FIXME_(win32)("(%p,%d),stub!\n",hprocess,x);
 	return 1;
 }
 
@@ -539,7 +540,7 @@
  *		SetProcessWindowStation (USER32.@)
  */
 BOOL WINAPI SetProcessWindowStation(HWINSTA hWinSta) {
-	FIXME_(win32)("(%d),stub!\n",hWinSta);
+	FIXME_(win32)("(%p),stub!\n",hWinSta);
 	return TRUE;
 }
 
@@ -551,7 +552,7 @@
 	PSECURITY_INFORMATION pSIRequested,
 	PSECURITY_DESCRIPTOR pSID
 ) {
-	FIXME_(win32)("(0x%08x,%p,%p),stub!\n",hObj,pSIRequested,pSID);
+	FIXME_(win32)("(%p,%p,%p),stub!\n",hObj,pSIRequested,pSID);
 	return TRUE;
 }
 
@@ -587,7 +588,7 @@
  *		EnumDesktopWindows (USER32.@)
  */
 BOOL WINAPI EnumDesktopWindows( HDESK hDesktop, WNDENUMPROC lpfn,
LPARAM lParam ) {
-  FIXME_(win32)("(0x%08x, %p, 0x%08lx), stub!\n", hDesktop, lpfn,
lParam );
+  FIXME_(win32)("(%p, %p, 0x%08lx), stub!\n", hDesktop, lpfn, lParam );
   return TRUE;
 }
 
@@ -597,7 +598,7 @@
  */
 BOOL WINAPI CloseWindowStation(HWINSTA hWinSta)
 {
-    FIXME_(win32)("(0x%08x)\n", hWinSta);
+    FIXME_(win32)("(%p)\n", hWinSta);
     return TRUE;
 }
 
@@ -606,7 +607,7 @@
  */
 BOOL WINAPI CloseDesktop(HDESK hDesk)
 {
-    FIXME_(win32)("(0x%08x)\n", hDesk);
+    FIXME_(win32)("(%p)\n", hDesk);
     return TRUE;
 }
 
@@ -622,7 +623,7 @@
  *		SetLogonNotifyWindow (USER32.@)
  */
 DWORD WINAPI SetLogonNotifyWindow(HWINSTA hwinsta,HWND hwnd) {
-	FIXME_(win32)("(0x%x,%04x),stub!\n",hwinsta,hwnd);
+	FIXME_(win32)("(%p,%p),stub!\n",hwinsta,hwnd);
 	return 1;
 }
 
@@ -637,14 +638,14 @@
  *		GetUserObjectInformationA (USER32.@)
  */
 BOOL WINAPI GetUserObjectInformationA( HANDLE hObj, INT nIndex, LPVOID
pvInfo, DWORD nLength, LPDWORD lpnLen )
-{	FIXME_(win32)("(0x%x %i %p %ld %p),stub!\n", hObj, nIndex, pvInfo,
nLength, lpnLen );
+{	FIXME_(win32)("(%p %i %p %ld %p),stub!\n", hObj, nIndex, pvInfo,
nLength, lpnLen );
 	return TRUE;
 }

/***********************************************************************
  *		GetUserObjectInformationW (USER32.@)
  */
 BOOL WINAPI GetUserObjectInformationW( HANDLE hObj, INT nIndex, LPVOID
pvInfo, DWORD nLength, LPDWORD lpnLen )
-{	FIXME_(win32)("(0x%x %i %p %ld %p),stub!\n", hObj, nIndex, pvInfo,
nLength, lpnLen );
+{	FIXME_(win32)("(%p %i %p %ld %p),stub!\n", hObj, nIndex, pvInfo,
nLength, lpnLen );
 	return TRUE;
 }

/***********************************************************************
@@ -652,7 +653,7 @@
  */
 BOOL WINAPI GetUserObjectSecurity(HANDLE hObj, PSECURITY_INFORMATION
pSIRequested,
 	PSECURITY_DESCRIPTOR pSID, DWORD nLength, LPDWORD lpnLengthNeeded)
-{	FIXME_(win32)("(0x%x %p %p len=%ld %p),stub!\n",  hObj, pSIRequested,
pSID, nLength, lpnLengthNeeded);
+{	FIXME_(win32)("(%p %p %p len=%ld %p),stub!\n",  hObj, pSIRequested,
pSID, nLength, lpnLengthNeeded);
 	return TRUE;
 }
 
@@ -660,7 +661,7 @@
  *		SetSystemCursor (USER32.@)
  */
 BOOL WINAPI SetSystemCursor(HCURSOR hcur, DWORD id)
-{	FIXME_(win32)("(%08x,%08lx),stub!\n",  hcur, id);
+{	FIXME_(win32)("(%p,%08lx),stub!\n",  hcur, id);
 	return TRUE;
 }
 
@@ -678,7 +679,7 @@
 HDEVNOTIFY WINAPI RegisterDeviceNotificationA(
 	HANDLE hnd, LPVOID notifyfilter, DWORD flags
 ) {
-	FIXME_(win32)("(hwnd=%08x, filter=%p,flags=0x%08lx), STUB!\n",
+	FIXME_(win32)("(hwnd=%p, filter=%p,flags=0x%08lx), STUB!\n",
 		hnd,notifyfilter,flags
 	);
 	return 0;
Index: windows/win.c
===================================================================
RCS file: /home/wine/wine/windows/win.c,v
retrieving revision 1.208
diff -u -u -r1.208 win.c
--- windows/win.c	22 Nov 2002 04:47:10 -0000	1.208
+++ windows/win.c	22 Nov 2002 20:43:50 -0000
@@ -348,7 +348,7 @@
         }
         if (IsWindow( hwnd )) /* check other processes */
         {
-            ERR( "window %04x belongs to other process\n", hwnd );
+            ERR( "window %p belongs to other process\n", hwnd );
             /* DbgBreakPoint(); */
         }
     }
@@ -410,7 +410,7 @@
     if (!wndPtr) return;
     if (wndPtr == WND_OTHER_PROCESS)
     {
-        if (IsWindow(hwnd)) ERR(" cannot link other process window
%x\n", hwnd );
+        if (IsWindow(hwnd)) ERR(" cannot link other process window
%p\n", hwnd );
         return;
     }
 
@@ -443,7 +443,7 @@
     if (!win) return 0;
     if (win == WND_OTHER_PROCESS)
     {
-        if (IsWindow(hwnd)) ERR( "cannot set owner %x on other process
window %x\n", owner, hwnd );
+        if (IsWindow(hwnd)) ERR( "cannot set owner %p on other process
window %p\n", owner, hwnd );
         return 0;
     }
     SERVER_START_REQ( set_window_owner )
@@ -477,7 +477,7 @@
     if (win == WND_OTHER_PROCESS)
     {
         if (IsWindow(hwnd))
-            ERR( "cannot set style %lx on other process window %x\n",
style, hwnd );
+            ERR( "cannot set style %lx on other process window %p\n",
style, hwnd );
         return 0;
     }
     if (style == win->dwStyle)
@@ -517,7 +517,7 @@
     if (win == WND_OTHER_PROCESS)
     {
         if (IsWindow(hwnd))
-            ERR( "cannot set exstyle %lx on other process window %x\n",
style, hwnd );
+            ERR( "cannot set exstyle %lx on other process window %p\n",
style, hwnd );
         return 0;
     }
     if (style == win->dwExStyle)
@@ -555,7 +555,7 @@
     if (!win) return;
     if (win == WND_OTHER_PROCESS)
     {
-        if (IsWindow( hwnd )) ERR( "cannot set rectangles of other
process window %x\n", hwnd );
+        if (IsWindow( hwnd )) ERR( "cannot set rectangles of other
process window %p\n", hwnd );
         return;
     }
     SERVER_START_REQ( set_window_rectangles )
@@ -577,7 +577,7 @@
         win->rectWindow = *rectWindow;
         win->rectClient = *rectClient;
 
-        TRACE( "win %x window (%d,%d)-(%d,%d) client
(%d,%d)-(%d,%d)\n", hwnd,
+        TRACE( "win %p window (%d,%d)-(%d,%d) client
(%d,%d)-(%d,%d)\n", hwnd,
                rectWindow->left, rectWindow->top, rectWindow->right,
rectWindow->bottom,
                rectClient->left, rectClient->top, rectClient->right,
rectClient->bottom );
     }
@@ -641,7 +641,7 @@
     WND *wndPtr;
     HWND *list;
 
-    TRACE("%04x\n", hwnd );
+    TRACE("%p\n", hwnd );
 
     if (!(hwnd = WIN_IsCurrentThread( hwnd )))
     {
@@ -793,8 +793,8 @@
         wine_server_call( req );
         pWndDesktop->dwStyle   = reply->old_style;
         pWndDesktop->dwExStyle = reply->old_ex_style;
-        pWndDesktop->hInstance = (ULONG_PTR)reply->old_instance;
-        pWndDesktop->userdata  = (ULONG_PTR)reply->old_user_data;
+        pWndDesktop->hInstance = HINSTANCE_32(reply->old_instance);
+        pWndDesktop->userdata  = LOWORD(reply->old_user_data);
         pWndDesktop->wIDmenu   = reply->old_id;
     }
     SERVER_END_REQ;
@@ -1007,7 +1007,7 @@
     DCE *dce;
     BOOL unicode = (type == WIN_PROC_32W);
 
-    TRACE("%s %s ex=%08lx style=%08lx %d,%d %dx%d parent=%04x menu=%04x
inst=%08x params=%p\n",
+    TRACE("%s %s ex=%08lx style=%08lx %d,%d %dx%d parent=%p menu=%p
inst=%p params=%p\n",
           (type == WIN_PROC_32W) ? debugstr_w((LPWSTR)cs->lpszName) :
debugstr_a(cs->lpszName),
           (type == WIN_PROC_32W) ? debugstr_w((LPWSTR)cs->lpszClass) :
debugstr_a(cs->lpszClass),
           cs->dwExStyle, cs->style, cs->x, cs->y, cs->cx, cs->cy,
@@ -1035,7 +1035,7 @@
 	/* Make sure parent is valid */
         if (!IsWindow( cs->hwndParent ))
         {
-            WARN("Bad parent %04x\n", cs->hwndParent );
+            WARN("Bad parent %p\n", cs->hwndParent );
 	    return 0;
 	}
         if ((cs->style & (WS_CHILD|WS_POPUP)) == WS_CHILD)
@@ -1152,9 +1152,9 @@
             if (menuName)
             {
                 if (HIWORD(cs->hInstance))
-                    cs->hMenu = LoadMenuA(cs->hInstance,menuName);
+                    cs->hMenu = LoadMenuA( cs->hInstance, menuName );
                 else
-                    cs->hMenu = LoadMenu16(cs->hInstance,menuName);
+                    cs->hMenu = HMENU_32( LoadMenu16( HINSTANCE_16(
cs->hInstance ), menuName ));
 
                 if (cs->hMenu) SetMenu( hwnd, cs->hMenu );
             }
@@ -1188,7 +1188,7 @@
     if (!(GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD) && !GetWindow(
hwnd, GW_OWNER ))
         HOOK_CallHooks( WH_SHELL, HSHELL_WINDOWCREATED, (WPARAM)hwnd,
0, TRUE );
 
-    TRACE("created window %04x\n", hwnd);
+    TRACE("created window %p\n", hwnd);
     return hwnd;
 }
 
@@ -1250,9 +1250,9 @@
     /* Create the window */
 
     cs.lpCreateParams = data;
-    cs.hInstance      = (HINSTANCE)instance;
-    cs.hMenu          = HMENU_32(menu);
-    cs.hwndParent     = WIN_Handle32( parent );
+    cs.hInstance      = HINSTANCE_32( instance );
+    cs.hMenu          = HMENU_32( menu );
+    cs.hwndParent     = HANDLE_32( parent );
     cs.style          = style;
     cs.lpszName       = windowName;
     cs.lpszClass      = className;
@@ -1440,7 +1440,7 @@
         return FALSE;
     }
 
-    TRACE("(%04x)\n", hwnd);
+    TRACE("(%p)\n", hwnd);
 
     /* Look whether the focus is within the tree of windows we will
      * be destroying.
@@ -1696,7 +1696,7 @@
 
     hwnd = full_handle;
 
-    TRACE("( %x, %d )\n", hwnd, enable);
+    TRACE("( %p, %d )\n", hwnd, enable);
 
     if (!(wndPtr = WIN_GetPtr( hwnd ))) return FALSE;
     style = wndPtr->dwStyle;
@@ -1767,7 +1767,7 @@
         if (wndPtr == WND_OTHER_PROCESS)
         {
             if (IsWindow( hwnd ))
-                FIXME( "(%d) not supported yet on other process window
%x\n", offset, hwnd );
+                FIXME( "(%d) not supported yet on other process window
%p\n", offset, hwnd );
             SetLastError( ERROR_INVALID_WINDOW_HANDLE );
             return 0;
         }
@@ -1827,7 +1827,7 @@
     if (wndPtr == WND_OTHER_PROCESS)
     {
         if (IsWindow(hwnd))
-            FIXME( "set %d <- %x not supported yet on other process
window %x\n",
+            FIXME( "set %d <- %x not supported yet on other process
window %p\n",
                    offset, newval, hwnd );
         wndPtr = NULL;
     }
@@ -1880,7 +1880,7 @@
         if (offset >= 0)
         {
             if (IsWindow(hwnd))
-                FIXME( "(%d) not supported on other process window
%x\n", offset, hwnd );
+                FIXME( "(%d) not supported on other process window
%p\n", offset, hwnd );
             SetLastError( ERROR_INVALID_WINDOW_HANDLE );
             return 0;
         }
@@ -1981,7 +1981,7 @@
     LONG retval = 0;
     WND *wndPtr;
 
-    TRACE( "%x %d %lx %x\n", hwnd, offset, newval, type );
+    TRACE( "%p %d %lx %x\n", hwnd, offset, newval, type );
 
     if (!WIN_IsCurrentProcess( hwnd ))
     {
@@ -2326,7 +2326,7 @@
 {
     if (!WIN_IsCurrentProcess( hwnd ))
     {
-        FIXME( "cannot set text %s of other process window %x\n",
debugstr_a(lpString), hwnd );
+        FIXME( "cannot set text %s of other process window %p\n",
debugstr_a(lpString), hwnd );
         SetLastError( ERROR_ACCESS_DENIED );
         return FALSE;
     }
@@ -2341,7 +2341,7 @@
 {
     if (!WIN_IsCurrentProcess( hwnd ))
     {
-        FIXME( "cannot set text %s of other process window %x\n",
debugstr_w(lpString), hwnd );
+        FIXME( "cannot set text %s of other process window %p\n",
debugstr_w(lpString), hwnd );
         SetLastError( ERROR_ACCESS_DENIED );
         return FALSE;
     }
@@ -3068,7 +3068,7 @@
 {
     WND *wndPtr = WIN_FindWndPtr(hWnd);
 
-    TRACE("%04x\n", hWnd);
+    TRACE("%p\n", hWnd);
 
     if (!wndPtr) return FALSE;
     hWnd = wndPtr->hwndSelf;  /* make it a full handle */
@@ -3180,7 +3180,7 @@
  */
 UINT WINAPI GetWindowModuleFileNameA( HWND hwnd, LPSTR lpszFileName,
UINT cchFileNameMax)
 {
-    FIXME("GetWindowModuleFileNameA(hwnd 0x%x, lpszFileName %p,
cchFileNameMax %u) stub!\n",
+    FIXME("GetWindowModuleFileNameA(hwnd %p, lpszFileName %p,
cchFileNameMax %u) stub!\n",
           hwnd, lpszFileName, cchFileNameMax);
     return 0;
 }
@@ -3190,7 +3190,7 @@
  */
 UINT WINAPI GetWindowModuleFileNameW( HWND hwnd, LPSTR lpszFileName,
UINT cchFileNameMax)
 {
-    FIXME("GetWindowModuleFileNameW(hwnd 0x%x, lpszFileName %p,
cchFileNameMax %u) stub!\n",
+    FIXME("GetWindowModuleFileNameW(hwnd %p, lpszFileName %p,
cchFileNameMax %u) stub!\n",
           hwnd, lpszFileName, cchFileNameMax);
     return 0;
 }
Index: windows/winpos.c
===================================================================
RCS file: /home/wine/wine/windows/winpos.c,v
retrieving revision 1.140
diff -u -u -r1.140 winpos.c
--- windows/winpos.c	31 Oct 2002 22:06:53 -0000	1.140
+++ windows/winpos.c	22 Nov 2002 20:43:51 -0000
@@ -161,7 +161,7 @@
     if (ret)
     {
         MapWindowPoints( GetAncestor( hwnd, GA_PARENT ), 0, (POINT
*)rect, 2 );
-        TRACE( "hwnd %04x (%d,%d)-(%d,%d)\n",
+        TRACE( "hwnd %p (%d,%d)-(%d,%d)\n",
                hwnd, rect->left, rect->top, rect->right, rect->bottom);
     }
     return ret;
@@ -179,7 +179,7 @@
     if (wndPtr == WND_OTHER_PROCESS)
     {
         if (IsWindow( hwnd ))
-            FIXME( "not supported on other process window %x\n", hwnd
);
+            FIXME( "not supported on other process window %p\n", hwnd
);
         wndPtr = NULL;
     }
     if (!wndPtr)
@@ -212,7 +212,7 @@
     if ((wndPtr = WIN_GetPtr( hwnd )) == WND_OTHER_PROCESS)
     {
         if (IsWindow( hwnd ))
-            FIXME( "not supported on other process window %x\n", hwnd
);
+            FIXME( "not supported on other process window %p\n", hwnd
);
         wndPtr = NULL;
     }
     if (!wndPtr)
@@ -384,7 +384,7 @@
     int res;
     LONG style;
 
-    TRACE("scope %04x %ld,%ld\n", hwndScope, pt.x, pt.y);
+    TRACE("scope %p %ld,%ld\n", hwndScope, pt.x, pt.y);
 
     if (!hwndScope) hwndScope = GetDesktopWindow();
     style = GetWindowLongW( hwndScope, GWL_STYLE );
@@ -405,7 +405,7 @@
             xy.y -= rectClient.top;
             if ((ret = find_child_from_point( hwndScope, xy, hittest,
MAKELONG( pt.x, pt.y ) )))
             {
-                TRACE( "found child %x\n", ret );
+                TRACE( "found child %p\n", ret );
                 return ret;
             }
         }
@@ -415,14 +415,14 @@
     if (!WIN_IsCurrentThread( hwndScope ))
     {
         *hittest = HTCLIENT;
-        TRACE( "returning %x\n", hwndScope );
+        TRACE( "returning %p\n", hwndScope );
         return hwndScope;
     }
     res = SendMessageA( hwndScope, WM_NCHITTEST, 0, MAKELONG( pt.x,
pt.y ) );
     if (res != HTTRANSPARENT)
     {
         *hittest = res;  /* Found the window */
-        TRACE( "returning %x\n", hwndScope );
+        TRACE( "returning %p\n", hwndScope );
         return hwndScope;
     }
     *hittest = HTNOWHERE;
@@ -509,7 +509,7 @@
             if (hwnd == hwndTo) return;
             if (!(wndPtr = WIN_GetPtr( hwnd )))
             {
-                ERR( "bad hwndFrom = %04x\n", hwnd );
+                ERR( "bad hwndFrom = %p\n", hwnd );
                 return;
             }
             if (wndPtr == WND_OTHER_PROCESS) goto other_process;
@@ -529,7 +529,7 @@
         {
             if (!(wndPtr = WIN_GetPtr( hwnd )))
             {
-                ERR( "bad hwndTo = %04x\n", hwnd );
+                ERR( "bad hwndTo = %p\n", hwnd );
                 return;
             }
             if (wndPtr == WND_OTHER_PROCESS) goto other_process;
@@ -637,7 +637,7 @@
  *		SetShellWindow (USER32.@)
  */
 HWND WINAPI SetShellWindow(HWND hwndshell)
-{   WARN("(hWnd=%08x) semi stub\n",hwndshell );
+{   WARN("(hWnd=%p) semi stub\n",hwndshell );
 
     hGlobalShellWindow = WIN_GetFullHandle( hwndshell );
     return hGlobalShellWindow;
@@ -648,7 +648,7 @@
  *		GetShellWindow (USER32.@)
  */
 HWND WINAPI GetShellWindow(void)
-{   WARN("(hWnd=%x) semi stub\n",hGlobalShellWindow );
+{   WARN("(hWnd=%p) semi stub\n",hGlobalShellWindow );
 
     return hGlobalShellWindow;
 }
@@ -671,7 +671,7 @@
 {
     int flags = SWP_NOZORDER | SWP_NOACTIVATE;
     if (!repaint) flags |= SWP_NOREDRAW;
-    TRACE("%04x %d,%d %dx%d %d\n",
+    TRACE("%p %d,%d %dx%d %d\n",
 	    hwnd, x, y, cx, cy, repaint );
     return SetWindowPos( hwnd, 0, x, y, cx, cy, flags );
 }
@@ -736,7 +736,7 @@
     {
         HWND title = lpPos->hwndIconTitle;
 
-	TRACE("0x%04x %i\n", hwnd, (bShow != 0) );
+	TRACE("%p %i\n", hwnd, (bShow != 0) );
 
 	if( !title )
 	    lpPos->hwndIconTitle = title = ICONTITLE_Create( hwnd );
@@ -1064,7 +1064,7 @@
 
  done:
     fg = GetForegroundWindow();
-    TRACE("win = %x fg = %x\n", hwndTo, fg);
+    TRACE("win = %p fg = %p\n", hwndTo, fg);
     if (!fg || (hwnd == fg))
     {
         if (SetForegroundWindow( hwndTo )) return;
@@ -1173,7 +1173,7 @@
 {
     WINDOWPOS winpos;
 
-    TRACE("hwnd %x, after %x, %d,%d (%dx%d), flags %08x\n",
+    TRACE("hwnd %p, after %p, %d,%d (%dx%d), flags %08x\n",
 	   hwnd, hwndInsertAfter, x, y, cx, cy, flags);
     if(TRACE_ON(win)) dump_winpos_flags(flags);
 
@@ -1358,7 +1358,7 @@
  */
 HWND WINAPI SetShellWindowEx ( HWND hwndProgman, HWND hwndListView )
 {
-	FIXME("0x%08x 0x%08x stub\n",hwndProgman ,hwndListView );
+	FIXME("%p %p stub\n",hwndProgman ,hwndListView );
 	hGlobalShellWindow = hwndProgman;
 	return hGlobalShellWindow;
 
Index: windows/winproc.c
===================================================================
RCS file: /home/wine/wine/windows/winproc.c,v
retrieving revision 1.96
diff -u -u -r1.96 winproc.c
--- windows/winproc.c	22 Nov 2002 04:47:10 -0000	1.96
+++ windows/winproc.c	22 Nov 2002 20:43:56 -0000
@@ -175,7 +175,7 @@
 
     hwnd = WIN_GetFullHandle( hwnd );
     if (TRACE_ON(relay))
-        DPRINTF( "%08lx:Call window proc %p
(hwnd=%08x,msg=%s,wp=%08x,lp=%08lx)\n",
+        DPRINTF( "%08lx:Call window proc %p
(hwnd=%p,msg=%s,wp=%08x,lp=%08lx)\n",
                  GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg,
hwnd), wParam, lParam );
     /* To avoid any deadlocks, all the locks on the windows structures
        must be suspended before the control is passed to the
application */
@@ -184,7 +184,7 @@
     WIN_RestoreWndsLock(iWndsLocks);
 
     if (TRACE_ON(relay))
-        DPRINTF( "%08lx:Ret  window proc %p
(hwnd=%08x,msg=%s,wp=%08x,lp=%08lx) retval=%08lx\n",
+        DPRINTF( "%08lx:Ret  window proc %p
(hwnd=%p,msg=%s,wp=%08x,lp=%08lx) retval=%08lx\n",
                  GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg,
hwnd), wParam, lParam, retvalue );
     return retvalue;
 }
@@ -1187,7 +1187,7 @@
             dis->itemState  = dis16->itemState;
             dis->hwndItem   = (dis->CtlType == ODT_MENU) ?
(HWND)HMENU_32(dis16->hwndItem)
                                                          :
WIN_Handle32( dis16->hwndItem );
-            dis->hDC        = dis16->hDC;
+            dis->hDC        = HDC_32( dis16->hDC );
             dis->itemData   = dis16->itemData;
             CONV_RECT16TO32( &dis16->rcItem, &dis->rcItem );
             *plparam = (LPARAM)dis;
@@ -1240,7 +1240,7 @@
         if((LOWORD(*plparam) & MF_POPUP) && (LOWORD(*plparam) !=
0xFFFF))
         {
             HMENU hmenu=HMENU_32(HIWORD(*plparam));
-            UINT Pos=MENU_FindSubMenu( &hmenu, wParam16);
+            UINT Pos=MENU_FindSubMenu( &hmenu, HMENU_32( wParam16 ));
             if(Pos==0xFFFF) Pos=0; /* NO_SELECTED_ITEM */
             *pwparam32 = MAKEWPARAM( Pos, LOWORD(*plparam) );
         }
@@ -1374,7 +1374,7 @@
 	    hi = HIWORD(*plparam);
 	    if (lo16 && !(lo32 = convert_handle_16_to_32(lo16,
GMEM_DDESHARE)))
 		return -1;
-	    *plparam = PackDDElParam(msg16, lo32, hi);
+	    *plparam = PackDDElParam(msg16, HANDLE_16( lo32 ), hi);
 	}
 	return 0; /* FIXME don't know how to free allocated memory (handle) 
!! */
     case WM_DDE_ACK:
@@ -1405,14 +1405,14 @@
 		MESSAGE("DDE_ACK: %x both atom and handle... choosing handle\n", hi);
 		/* fall thru */
 	    case 2:
-		hi = convert_handle_16_to_32(hi, GMEM_DDESHARE);
+		hi = HINSTANCE_16( convert_handle_16_to_32(hi, GMEM_DDESHARE) );
 		break;
 	    }
 	    *plparam = PackDDElParam(WM_DDE_ACK, lo, hi);
 	}
 	return 0; /* FIXME don't know how to free allocated memory (handle) !!
*/
     case WM_DDE_EXECUTE:
-	*plparam = convert_handle_16_to_32(*plparam, GMEM_DDESHARE);
+	*plparam = HINSTANCE_16( convert_handle_16_to_32(*plparam,
GMEM_DDESHARE));
         return 0; /* FIXME don't know how to free allocated memory
(handle) !! */
     default:  /* No translation needed */
         return 0;
@@ -2154,7 +2154,7 @@
 
 	    *pwparam16 = HWND_16((HWND)wParam32);
             UnpackDDElParam(msg32, *plparam, &lo32, &hi);
-	    if (lo32 && !(lo16 = convert_handle_32_to_16(lo32,
GMEM_DDESHARE)))
+	    if (lo32 && !(lo16 = convert_handle_32_to_16(HANDLE_32(lo32),
GMEM_DDESHARE)))
 		return -1;
 	    *plparam = MAKELPARAM(lo16, hi);
 	}
@@ -2170,7 +2170,7 @@
             UnpackDDElParam(msg32, *plparam, &lo, &hi);
 
 	    if (GlobalGetAtomNameA((ATOM)hi, buf, sizeof(buf)) > 0) flag |= 1;
-	    if (GlobalSize(hi) != 0) flag |= 2;
+	    if (GlobalSize(HINSTANCE_32( hi )) != 0) flag |= 2;
 	    switch (flag)
 	    {
 	    case 0:
@@ -2186,14 +2186,14 @@
 		MESSAGE("DDE_ACK: %x both atom and handle... choosing handle\n", hi);
 		/* fall thru */
 	    case 2:
-		hi = convert_handle_32_to_16(hi, GMEM_DDESHARE);
+		hi = convert_handle_32_to_16( HINSTANCE_32( hi ), GMEM_DDESHARE);
 		break;
 	    }
 	    *plparam = MAKELPARAM(lo, hi);
 	}
 	return 0; /* FIXME don't know how to free allocated memory (handle) !!
*/
     case WM_DDE_EXECUTE:
-	*plparam = convert_handle_32_to_16(*plparam, GMEM_DDESHARE);
+	*plparam = convert_handle_32_to_16( HINSTANCE_32( *plparam ),
GMEM_DDESHARE);
         return 0; /* FIXME don't know how to free allocated memory
(handle) !! */
     default:  /* No translation needed */
         return 0;
@@ -2573,7 +2573,7 @@
     LRESULT result;
     int unmap;
 
-    TRACE_(msg)("func %p (hwnd=%08x,msg=%s,wp=%08x,lp=%08lx)\n",
+    TRACE_(msg)("func %p (hwnd=%p,msg=%s,wp=%08x,lp=%08lx)\n",
 	func, hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
 
     if( (unmap = WINPROC_MapMsg32ATo32W( hwnd, msg, &wParam, &lParam ))
== -1) {
@@ -2599,7 +2599,7 @@
     LRESULT result;
     int unmap;
 
-    TRACE_(msg)("func %p (hwnd=%08x,msg=%s,wp=%08x,lp=%08lx)\n",
+    TRACE_(msg)("func %p (hwnd=%p,msg=%s,wp=%08x,lp=%08lx)\n",
 	func, hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
 
     if ((unmap = WINPROC_MapMsg32WTo32A( hwnd, msg, &wParam, &lParam ))
== -1) {
@@ -2661,7 +2661,7 @@
     UINT16 msg16;
     MSGPARAM16 mp16;
 
-    TRACE_(msg)("func %p (hwnd=%08x,msg=%s,wp=%08x,lp=%08lx)\n",
+    TRACE_(msg)("func %p (hwnd=%p,msg=%s,wp=%08x,lp=%08lx)\n",
 	func, hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
 
     mp16.lParam = lParam;
@@ -2686,7 +2686,7 @@
     UINT16 msg16;
     MSGPARAM16 mp16;
 
-    TRACE_(msg)("func %p (hwnd=%08x,msg=%s,wp=%08x,lp=%08lx)\n",
+    TRACE_(msg)("func %p (hwnd=%p,msg=%s,wp=%08x,lp=%08lx)\n",
 	func, hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
 
     mp16.lParam = lParam;
Index: controls/combo.c
===================================================================
RCS file: /home/wine/wine/controls/combo.c,v
retrieving revision 1.92
diff -u -u -r1.92 combo.c
--- controls/combo.c	13 Nov 2002 21:18:32 -0000	1.92
+++ controls/combo.c	22 Nov 2002 20:43:56 -0000
@@ -169,7 +169,7 @@
 
    if( lphc )
    {
-       TRACE("[%04x]: freeing storage\n", lphc->self);
+       TRACE("[%p]: freeing storage\n", lphc->self);
 
        if( (CB_GETTYPE(lphc) != CBS_SIMPLE) && lphc->hWndLBox )
    	   DestroyWindow( lphc->hWndLBox );
@@ -1000,7 +1000,7 @@
   hDC = (hParamDC) ? hParamDC
 		   : BeginPaint( lphc->self, &ps);
 
-  TRACE("hdc=%04x\n", hDC);
+  TRACE("hdc=%p\n", hDC);
 
   if( hDC && !(lphc->wState & CBF_NOREDRAW) )
   {
@@ -1150,7 +1150,7 @@
    int nItems = 0;
    int nDroppedHeight;
 
-   TRACE("[%04x]: drop down\n", lphc->self);
+   TRACE("[%p]: drop down\n", lphc->self);
 
    CB_NOTIFY( lphc, CBN_DROPDOWN );
 
@@ -1244,7 +1244,7 @@
 {
    HWND	hWnd = lphc->self;
 
-   TRACE("[%04x]: sel ok? [%i] dropped? [%i]\n",
+   TRACE("[%p]: sel ok? [%i] dropped? [%i]\n",
 	 lphc->self, (INT)ok, (INT)(lphc->wState & CBF_DROPPED));
 
    CB_NOTIFY( lphc, (ok) ? CBN_SELENDOK : CBN_SELENDCANCEL );
@@ -1377,7 +1377,7 @@
        {
 	   case (EN_SETFOCUS >> 8):
 
-		TRACE("[%04x]: edit [%04x] got focus\n",
+		TRACE("[%p]: edit [%p] got focus\n",
 			     lphc->self, lphc->hWndEdit );
 
 		COMBO_SetFocus( lphc );
@@ -1385,7 +1385,7 @@
 
 	   case (EN_KILLFOCUS >> 8):
 
-		TRACE("[%04x]: edit [%04x] lost focus\n",
+		TRACE("[%p]: edit [%p] lost focus\n",
 			     lphc->self, lphc->hWndEdit );
 
 		/* NOTE: it seems that Windows' edit control sends an
@@ -1443,7 +1443,7 @@
 	   case LBN_SELCHANGE:
 	   case LBN_SELCANCEL:
 
-		TRACE("[%04x]: lbox selection change [%04x]\n",
+		TRACE("[%p]: lbox selection change [%04x]\n",
 			     lphc->self, lphc->wState );
 
 		if( HIWORD(wParam) == LBN_SELCHANGE)
@@ -1492,7 +1492,7 @@
    HWND hWnd = lphc->self;
    UINT id = GetWindowLongA( hWnd, GWL_ID );
 
-   TRACE("[%04x]: ownerdraw op %04x\n", lphc->self, msg );
+   TRACE("[%p]: ownerdraw op %04x\n", lphc->self, msg );
 
    switch( msg )
    {
@@ -1911,7 +1911,7 @@
 {
       LPHEADCOMBO lphc = (LPHEADCOMBO)GetWindowLongA( hwnd, 0 );
 
-      TRACE("[%04x]: msg %s wp %08x lp %08lx\n",
+      TRACE("[%p]: msg %s wp %08x lp %08lx\n",
             hwnd, SPY_GetMsgName(message, hwnd), wParam, lParam );
 
       if( lphc || message == WM_NCCREATE )
Index: controls/edit.c
===================================================================
RCS file: /home/wine/wine/controls/edit.c,v
retrieving revision 1.106
diff -u -u -r1.106 edit.c
--- controls/edit.c	22 Nov 2002 04:47:11 -0000	1.106
+++ controls/edit.c	22 Nov 2002 20:43:56 -0000
@@ -154,7 +154,7 @@
 #define EDIT_NOTIFY_PARENT(es, wNotifyCode, str) \
 	do \
 	{ /* Notify parent which has created this edit control */ \
-	    TRACE("notification " str " sent to hwnd=%08x\n", es->hwndParent);
\
+	    TRACE("notification " str " sent to hwnd=%p\n", es->hwndParent); \
 	    SendMessageW(es->hwndParent, WM_COMMAND, \
 		     MAKEWPARAM(GetWindowLongW((es->hwndSelf),GWL_ID), wNotifyCode),
\
 		     (LPARAM)(es->hwndSelf)); \
@@ -419,7 +419,7 @@
 	EDITSTATE *es = (EDITSTATE *)GetWindowLongW( hwnd, 0 );
 	LRESULT result = 0;
 
-        TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n", hwnd, msg,
wParam, lParam);
+        TRACE("hwnd=%p msg=%x wparam=%x lparam=%lx\n", hwnd, msg,
wParam, lParam);
 	
 	if (!es && msg != WM_NCCREATE)
 		return DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
@@ -1710,7 +1710,7 @@
 	if (es->hloc32W) {
 	    UINT alloc_size = ROUND_TO_GROW((size + 1) * sizeof(WCHAR));
 	    if ((hNew32W = LocalReAlloc(es->hloc32W, alloc_size, LMEM_MOVEABLE
| LMEM_ZEROINIT))) {
-		TRACE("Old 32 bit handle %08x, new handle %08x\n", es->hloc32W,
hNew32W);
+		TRACE("Old 32 bit handle %p, new handle %p\n", es->hloc32W, hNew32W);
 		es->hloc32W = hNew32W;
 		es->buffer_size = LocalSize(hNew32W)/sizeof(WCHAR) - 1;
 	    }
@@ -2185,7 +2185,7 @@
 	/* Edit window might be already destroyed */
 	if(!IsWindow(es->hwndSelf))
 	{
-	    WARN("edit hwnd %04x already destroyed\n", es->hwndSelf);
+	    WARN("edit hwnd %p already destroyed\n", es->hwndSelf);
 	    return;
     	}
 
@@ -2468,7 +2468,7 @@
 	    hLocal = es->hloc32A;
 	}
 
-	TRACE("Returning %04X, LocalSize() = %ld\n", hLocal,
LocalSize(hLocal));
+	TRACE("Returning %p, LocalSize() = %ld\n", hLocal, LocalSize(hLocal));
 	return hLocal;
 }
 
@@ -3981,7 +3981,7 @@
    bDropped = TRUE;
    nEUI     = 0;
 
-   TRACE_(combo)("[%04x]: handling msg %04x (%04x)\n",
+   TRACE_(combo)("[%p]: handling msg %04x (%04x)\n",
        		     es->hwndSelf, (UINT16)msg, (UINT16)key);
 
    if (key == VK_UP || key == VK_DOWN)
Index: controls/listbox.c
===================================================================
RCS file: /home/wine/wine/controls/listbox.c,v
retrieving revision 1.88
diff -u -u -r1.88 listbox.c
--- controls/listbox.c	31 Oct 2002 22:06:53 -0000	1.88
+++ controls/listbox.c	22 Nov 2002 20:43:57 -0000
@@ -178,7 +178,7 @@
     LB_DESCR *descr = (LB_DESCR *)GetWindowLongA( hwnd, 0 );
 
     TRACE( "Listbox:\n" );
-    TRACE( "hwnd=%04x descr=%08x items=%d top=%d\n",
+    TRACE( "hwnd=%p descr=%08x items=%d top=%d\n",
                      hwnd, (UINT)descr, descr->nb_items,
                      descr->top_item );
     for (i = 0, item = descr->items; i < descr->nb_items; i++, item++)
@@ -421,7 +421,7 @@
                 if ((descr->item_height - remaining) <= ncheight)
                     remaining = remaining - descr->item_height;
             }
-            TRACE("[%04x]: changing height %d -> %d\n",
+            TRACE("[%p]: changing height %d -> %d\n",
                   hwnd, descr->height, descr->height - remaining );
             SetWindowPos( hwnd, 0, 0, 0, rect.right - rect.left,
                             rect.bottom - rect.top - remaining,
@@ -429,7 +429,7 @@
             return;
         }
     }
-    TRACE("[%04x]: new size = %d,%d\n", hwnd, descr->width,
descr->height );
+    TRACE("[%p]: new size = %d,%d\n", hwnd, descr->width, descr->height
);
     LISTBOX_UpdatePage( hwnd, descr );
     LISTBOX_UpdateScroll( hwnd, descr );
 
@@ -590,7 +590,7 @@
         if (!IsWindowEnabled(hwnd)) dis.itemState |= ODS_DISABLED;
         dis.itemData     = item ? item->data : 0;
         dis.rcItem       = *rect;
-        TRACE("[%04x]: drawitem %d (%s) action=%02x state=%02x
rect=%d,%d-%d,%d\n",
+        TRACE("[%p]: drawitem %d (%s) action=%02x state=%02x
rect=%d,%d-%d,%d\n",
               hwnd, index, item ? debugstr_w(item->str) : "", action,
               dis.itemState, rect->left, rect->top, rect->right,
rect->bottom );
         SendMessageW(descr->owner, WM_DRAWITEM, id, (LPARAM)&dis);
@@ -610,7 +610,7 @@
             oldText = SetTextColor( hdc,
GetSysColor(COLOR_HIGHLIGHTTEXT));
         }
 
-        TRACE("[%04x]: painting %d (%s) action=%02x
rect=%d,%d-%d,%d\n",
+        TRACE("[%p]: painting %d (%s) action=%02x rect=%d,%d-%d,%d\n",
               hwnd, index, item ? debugstr_w(item->str) : "", action,
               rect->left, rect->top, rect->right, rect->bottom );
         if (!item)
@@ -748,7 +748,7 @@
         INT i;
         LPINT16 p = (LPINT16)tabs;
 
-        TRACE("[%04x]: settabstops ", hwnd );
+        TRACE("[%p]: settabstops ", hwnd );
         for (i = 0; i < descr->nb_tabs; i++) {
 	    descr->tabs[i] = *p++<<1; /* FIXME */
             if (TRACE_ON(listbox)) DPRINTF("%hd ", descr->tabs[i]);
@@ -1159,7 +1159,7 @@
     if (descr->style & LBS_OWNERDRAWVARIABLE)
     {
         if ((index < 0) || (index >= descr->nb_items)) return LB_ERR;
-        TRACE("[%04x]: item %d height = %d\n", hwnd, index, height );
+        TRACE("[%p]: item %d height = %d\n", hwnd, index, height );
         descr->items[index].height = height;
         LISTBOX_UpdateScroll( hwnd, descr );
 	if (repaint)
@@ -1167,7 +1167,7 @@
     }
     else if (height != descr->item_height)
     {
-        TRACE("[%04x]: new height = %d\n", hwnd, height );
+        TRACE("[%p]: new height = %d\n", hwnd, height );
         descr->item_height = height;
         LISTBOX_UpdatePage( hwnd, descr );
         LISTBOX_UpdateScroll( hwnd, descr );
@@ -1189,7 +1189,7 @@
         pos = descr->horz_extent - descr->width;
     if (pos < 0) pos = 0;
     if (!(diff = descr->horz_pos - pos)) return;
-    TRACE("[%04x]: new horz pos = %d\n", hwnd, pos );
+    TRACE("[%p]: new horz pos = %d\n", hwnd, pos );
     descr->horz_pos = pos;
     LISTBOX_UpdateScroll( hwnd, descr );
     if (abs(diff) < descr->width)
@@ -1210,7 +1210,7 @@
         return LB_OKAY;
     if (extent <= 0) extent = 1;
     if (extent == descr->horz_extent) return LB_OKAY;
-    TRACE("[%04x]: new horz extent = %d\n", hwnd, extent );
+    TRACE("[%p]: new horz extent = %d\n", hwnd, extent );
     descr->horz_extent = extent;
     if (descr->horz_pos > extent - descr->width)
         LISTBOX_SetHorizontalPos( hwnd, descr, extent - descr->width );
@@ -1226,7 +1226,7 @@
 static LRESULT LISTBOX_SetColumnWidth( HWND hwnd, LB_DESCR *descr, INT
width)
 {
     if (width == descr->column_width) return LB_OKAY;
-    TRACE("[%04x]: new column width = %d\n", hwnd, width );
+    TRACE("[%p]: new column width = %d\n", hwnd, width );
     descr->column_width = width;
     LISTBOX_UpdatePage( hwnd, descr );
     return LB_OKAY;
@@ -1509,7 +1509,7 @@
         mis.itemHeight = descr->item_height;
         SendMessageW( descr->owner, WM_MEASUREITEM, id, (LPARAM)&mis );
         item->height = mis.itemHeight ? mis.itemHeight : 1;
-        TRACE("[%04x]: measure item %d (%s) = %d\n",
+        TRACE("[%p]: measure item %d (%s) = %d\n",
               hwnd, index, str ? debugstr_w(str) : "", item->height );
     }
 
@@ -1570,7 +1570,7 @@
         return ret;
     }
 
-    TRACE("[%04x]: added item %d %s\n",
+    TRACE("[%p]: added item %d %s\n",
           hwnd, index, HAS_STRINGS(descr) ? debugstr_w(new_str) : "" );
     return index;
 }
@@ -1946,7 +1946,7 @@
                                           WPARAM wParam, INT x, INT y )
 {
     INT index = LISTBOX_GetItemFromPoint( descr, x, y );
-    TRACE("[%04x]: lbuttondown %d,%d item %d\n", hwnd, x, y, index );
+    TRACE("[%p]: lbuttondown %d,%d item %d\n", hwnd, x, y, index );
     if (!descr->caret_on && (descr->in_focus)) return 0;
 
     if (!descr->in_focus)
@@ -2420,7 +2420,7 @@
 
     if( lphc )
     {
-	TRACE_(combo)("[%04x]: resetting owner %04x -> %04x\n",
+	TRACE_(combo)("[%p]: resetting owner %p -> %p\n",
                       hwnd, descr->owner, lphc->self );
         descr->owner = lphc->self;
     }
@@ -2455,7 +2455,7 @@
 	}
     }
 
-    TRACE("owner: %04x, style: %08x, width: %d, height: %d\n",
descr->owner, descr->style, descr->width, descr->height);
+    TRACE("owner: %p, style: %08x, width: %d, height: %d\n",
descr->owner, descr->style, descr->width, descr->height);
     return TRUE;
 }
 
@@ -2487,7 +2487,7 @@
         {
             if (!LISTBOX_Create( hwnd, NULL ))
                 return -1;
-            TRACE("creating wnd=%04x descr=%lx\n", hwnd,
GetWindowLongA( hwnd, 0 ) );
+            TRACE("creating wnd=%p descr=%lx\n", hwnd, GetWindowLongA(
hwnd, 0 ) );
             return 0;
         }
         /* Ignore all other messages before we get a WM_CREATE */
@@ -2495,7 +2495,7 @@
                          DefWindowProcA( hwnd, msg, wParam, lParam );
     }
 
-    TRACE("[%04x]: msg %s wp %08x lp %08lx\n",
+    TRACE("[%p]: msg %s wp %08x lp %08lx\n",
           hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam );
     switch(msg)
     {
@@ -2989,7 +2989,7 @@
             RECT rect;
             HBRUSH hbrush = (HBRUSH)SendMessageW( descr->owner,
WM_CTLCOLORLISTBOX,
                                               wParam, (LPARAM)hwnd );
-	    TRACE("hbrush = %04x\n", hbrush);
+	    TRACE("hbrush = %p\n", hbrush);
 	    if(!hbrush)
 		hbrush = GetSysColorBrush(COLOR_WINDOW);
 	    if(hbrush)
@@ -3007,7 +3007,7 @@
 
     default:
         if ((msg >= WM_USER) && (msg < 0xc000))
-            WARN("[%04x]: unknown msg %04x wp %08x lp %08lx\n",
+            WARN("[%p]: unknown msg %04x wp %08x lp %08lx\n",
                  hwnd, msg, wParam, lParam );
         return unicode ? DefWindowProcW( hwnd, msg, wParam, lParam ) :
                          DefWindowProcA( hwnd, msg, wParam, lParam );
@@ -3062,7 +3062,7 @@
                          DefWindowProcA( hwnd, msg, wParam, lParam );
     }
 
-    TRACE_(combo)("[%04x]: msg %s wp %08x lp %08lx\n",
+    TRACE_(combo)("[%p]: msg %s wp %08x lp %08lx\n",
                   hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam );
 
     if ((lphc = descr->lphc) != NULL)
Index: controls/menu.c
===================================================================
RCS file: /home/wine/wine/controls/menu.c,v
retrieving revision 1.153
diff -u -u -r1.153 menu.c
--- controls/menu.c	22 Nov 2002 04:47:11 -0000	1.153
+++ controls/menu.c	22 Nov 2002 20:43:59 -0000
@@ -219,7 +219,7 @@
 	int type = MENU_ITEM_TYPE(flags);
 	DPRINTF( "{ ID=0x%x", mp->wID);
 	if (flags & MF_POPUP)
-	    DPRINTF( ", Sub=0x%x", mp->hSubMenu);
+	    DPRINTF( ", Sub=%p", mp->hSubMenu);
 	if (flags) {
 	    int count = 0;
 	    DPRINTF( ", Type=");
@@ -261,9 +261,9 @@
 		DPRINTF( "+0x%x", flags);
 	}
 	if (mp->hCheckBit)
-	    DPRINTF( ", Chk=0x%x", mp->hCheckBit);
+	    DPRINTF( ", Chk=%p", mp->hCheckBit);
 	if (mp->hUnCheckBit)
-	    DPRINTF( ", Unc=0x%x", mp->hUnCheckBit);
+	    DPRINTF( ", Unc=%p", mp->hUnCheckBit);
 
 	if (type == MFT_STRING) {
 	    if (mp->text)
@@ -298,7 +298,7 @@
     POPUPMENU *menu = USER_HEAP_LIN_ADDR(hMenu);
     if (!menu || menu->wMagic != MENU_MAGIC)
     {
-        WARN("invalid menu handle=%x, ptr=%p, magic=%x\n", hMenu, menu,
menu? menu->wMagic:0);
+        WARN("invalid menu handle=%p, ptr=%p, magic=%x\n", hMenu, menu,
menu? menu->wMagic:0);
         menu = NULL;
     }
     return menu;
@@ -338,7 +338,7 @@
     else
 	ERR("Unable to load default system menu\n" );
 
-    TRACE("returning %x.\n", hMenu );
+    TRACE("returning %p.\n", hMenu );
 
     return hMenu;
 }
@@ -357,13 +357,13 @@
 {
     HMENU hMenu;
 
-    TRACE("loading system menu, hWnd %04x, hPopupMenu %04x\n", hWnd,
hPopupMenu);
+    TRACE("loading system menu, hWnd %p, hPopupMenu %p\n", hWnd,
hPopupMenu);
     if ((hMenu = CreateMenu()))
     {
 	POPUPMENU *menu = MENU_GetMenu(hMenu);
 	menu->wFlags = MF_SYSMENU;
 	menu->hWnd = WIN_GetFullHandle( hWnd );
-	TRACE("hWnd %04x (hMenu %04x)\n", menu->hWnd, hMenu);
+	TRACE("hWnd %p (hMenu %p)\n", menu->hWnd, hMenu);
 
 	if (hPopupMenu == (HMENU)(-1))
 	    hPopupMenu = MENU_CopySysPopup();
@@ -378,7 +378,7 @@
             menu->items[0].fState = 0;
             if ((menu = MENU_GetMenu(hPopupMenu))) menu->wFlags |=
MF_SYSMENU;
 
-	    TRACE("hMenu=%04x (hPopup %04x)\n", hMenu, hPopupMenu );
+	    TRACE("hMenu=%p (hPopup %p)\n", hMenu, hPopupMenu );
 	    return hMenu;
 	}
 	DestroyMenu( hMenu );
@@ -551,7 +551,7 @@
     POPUPMENU *menu;
     UINT i;
 
-    if (((*hmenu)==0xffff) || (!(menu = MENU_GetMenu(*hmenu)))) return
NULL;
+    if (((int)(*hmenu)==0xffff) || (!(menu = MENU_GetMenu(*hmenu))))
return NULL;
     if (wFlags & MF_BYPOSITION)
     {
 	if (*nPos >= menu->nItems) return NULL;
@@ -664,7 +664,7 @@
 static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu,
 				  UINT key, BOOL forceMenuChar )
 {
-    TRACE("\tlooking for '%c' in [%x]\n", (char)key, hmenu );
+    TRACE("\tlooking for '%c' in [%p]\n", (char)key, hmenu );
 
     if (!IsMenu( hmenu )) hmenu = GetSubMenu(
get_win_sys_menu(hwndOwner), 0);
 
@@ -855,7 +855,7 @@
     WCHAR *p;
     UINT check_bitmap_width = GetSystemMetrics( SM_CXMENUCHECK );
 
-    TRACE("dc=0x%04x owner=0x%04x (%d,%d)\n", hdc, hwndOwner, orgX,
orgY);
+    TRACE("dc=%p owner=%p (%d,%d)\n", hdc, hwndOwner, orgX, orgY);
     debug_print_menuitem("MENU_CalcItemSize: menuitem:", lpitem,
 			 (menuBar ? " (MenuBar)" : ""));
 
@@ -1168,8 +1168,8 @@
         dis.hwndItem   = (HWND)hmenu;
         dis.hDC        = hdc;
         dis.rcItem     = lpitem->rect;
-        TRACE("Ownerdraw: owner=%04x itemID=%d, itemState=%d,
itemAction=%d, "
-	      "hwndItem=%04x, hdc=%04x, rcItem={%d,%d,%d,%d}\n", hwndOwner,
+        TRACE("Ownerdraw: owner=%p itemID=%d, itemState=%d,
itemAction=%d, "
+	      "hwndItem=%p, hdc=%p, rcItem={%d,%d,%d,%d}\n", hwndOwner,
 	      dis.itemID, dis.itemState, dis.itemAction, dis.hwndItem,
 	      dis.hDC, dis.rcItem.left, dis.rcItem.top, dis.rcItem.right,
 	      dis.rcItem.bottom);
@@ -1440,7 +1440,7 @@
     HBRUSH hPrevBrush = 0;
     RECT rect;
 
-    TRACE("wnd=0x%04x dc=0x%04x menu=0x%04x\n", hwnd, hdc, hmenu);
+    TRACE("wnd=%p dc=%p menu=%p\n", hwnd, hdc, hmenu);
 
     GetClientRect( hwnd, &rect );
 
@@ -1526,7 +1526,7 @@
         goto END;
     }
 
-    TRACE("(%04x, %p, %p)\n", hDC, lprect, lppop);
+    TRACE("(%p, %p, %p)\n", hDC, lprect, lppop);
 
     hfontOld = SelectObject( hDC, hMenuFont);
 
@@ -1586,7 +1586,7 @@
     POPUPMENU *menu;
     UINT width, height;
 
-    TRACE("owner=0x%04x hmenu=0x%04x id=0x%04x x=0x%04x y=0x%04x
xa=0x%04x ya=0x%04x\n",
+    TRACE("owner=%p hmenu=%p id=0x%04x x=0x%04x y=0x%04x xa=0x%04x
ya=0x%04x\n",
     hwndOwner, hmenu, id, x, y, xanchor, yanchor);
 
     if (!(menu = MENU_GetMenu( hmenu ))) return FALSE;
@@ -1657,7 +1657,7 @@
     LPPOPUPMENU lppop;
     HDC hdc;
 
-    TRACE("owner=0x%04x menu=0x%04x index=0x%04x select=0x%04x\n",
hwndOwner, hmenu, wIndex, sendMenuSelect);
+    TRACE("owner=%p menu=%p index=0x%04x select=0x%04x\n", hwndOwner,
hmenu, wIndex, sendMenuSelect);
 
     lppop = MENU_GetMenu( hmenu );
     if ((!lppop) || (!lppop->nItems) || (!lppop->hWnd)) return;
@@ -1725,7 +1725,7 @@
     INT i;
     POPUPMENU *menu;
 
-    TRACE("hwnd=0x%04x hmenu=0x%04x off=0x%04x\n", hwndOwner, hmenu,
offset);
+    TRACE("hwnd=%p hmenu=%p off=0x%04x\n", hwndOwner, hmenu, offset);
 
     menu = MENU_GetMenu( hmenu );
     if ((!menu) || (!menu->items)) return;
@@ -1789,7 +1789,7 @@
         }
     }
     else if (IS_BITMAP_ITEM(flags))
-        item->text = (LPWSTR)(HBITMAP)LOWORD(str);
+        item->text = (LPWSTR)HBITMAP_32(str);
     else item->text = NULL;
 
     if (flags & MF_OWNERDRAW)
@@ -2019,7 +2019,7 @@
 {
     POPUPMENU *menu = MENU_GetMenu( hmenu );
 
-    TRACE("owner=0x%04x hmenu=0x%04x 0x%04x\n", hwndOwner, hmenu,
sendMenuSelect);
+    TRACE("owner=%p hmenu=%p 0x%04x\n", hwndOwner, hmenu,
sendMenuSelect);
 
     if (menu && top_popup)
     {
@@ -2059,7 +2059,7 @@
     MENUITEM *item;
     HDC hdc;
 
-    TRACE("owner=0x%04x hmenu=0x%04x 0x%04x\n", hwndOwner, hmenu,
selectFirst);
+    TRACE("owner=%p hmenu=%p 0x%04x\n", hwndOwner, hmenu, selectFirst);
 
     if (!(menu = MENU_GetMenu( hmenu ))) return hmenu;
 
@@ -2191,14 +2191,14 @@
     MENUITEM *item;
     POPUPMENU *menu = MENU_GetMenu( hMenu );
 
-    TRACE("%p hmenu=0x%04x\n", pmt, hMenu);
+    TRACE("%p hmenu=%p\n", pmt, hMenu);
 
     if (!menu || !menu->nItems ||
 	(menu->FocusedItem == NO_SELECTED_ITEM)) return -1;
 
     item = &menu->items[menu->FocusedItem];
 
-    TRACE("%08x %08x %08x\n",
+    TRACE("%p %08x %p\n",
                  hMenu, item->wID, item->hSubMenu);
 
     if (!(item->fType & MF_POPUP))
@@ -2234,7 +2234,7 @@
     POPUPMENU *ptmenu = MENU_GetMenu( hPtMenu );
     POPUPMENU *topmenu = MENU_GetMenu( pmt->hTopMenu );
 
-    TRACE("%p hmenu=0x%04x 0x%04x\n", pmt, hPtMenu, id);
+    TRACE("%p hmenu=%p 0x%04x\n", pmt, hPtMenu, id);
 
     if( pmt->hTopMenu != hPtMenu &&
 	!((ptmenu->wFlags | topmenu->wFlags) & MF_POPUP) )
@@ -2256,7 +2256,7 @@
  */
 static BOOL MENU_ButtonDown( MTRACKER* pmt, HMENU hPtMenu, UINT wFlags
)
 {
-    TRACE("%p hPtMenu=0x%04x\n", pmt, hPtMenu);
+    TRACE("%p hPtMenu=%p\n", pmt, hPtMenu);
 
     if (hPtMenu)
     {
@@ -2301,7 +2301,7 @@
  */
 static INT MENU_ButtonUp( MTRACKER* pmt, HMENU hPtMenu, UINT wFlags)
 {
-    TRACE("%p hmenu=0x%04x\n", pmt, hPtMenu);
+    TRACE("%p hmenu=%p\n", pmt, hPtMenu);
 
     if (hPtMenu)
     {
@@ -2411,7 +2411,7 @@
         next_menu.hwndNext = 0;
         SendMessageW( pmt->hOwnerWnd, WM_NEXTMENU, vk,
(LPARAM)&next_menu );
 
-	TRACE("%04x [%04x] -> %04x [%04x]\n",
+	TRACE("%p [%p] -> %p [%p]\n",
               pmt->hCurrentMenu, pmt->hOwnerWnd, next_menu.hmenuNext,
next_menu.hwndNext );
 
 	if (!next_menu.hmenuNext || !next_menu.hwndNext)
@@ -2623,7 +2623,7 @@
     POPUPMENU *menu = MENU_GetMenu( pmt->hTopMenu );
     UINT  nextcol;
 
-    TRACE("MENU_KeyRight called, cur %x (%s), top %x (%s).\n",
+    TRACE("MENU_KeyRight called, cur %p (%s), top %p (%s).\n",
 		  pmt->hCurrentMenu,
 		  debugstr_w((MENU_GetMenu(pmt->hCurrentMenu))->
 		     items[0].text),
@@ -2690,7 +2690,7 @@
     mt.pt.x = x;
     mt.pt.y = y;
 
-    TRACE("hmenu=0x%04x flags=0x%08x (%d,%d) hwnd=0x%04x
(%d,%d)-(%d,%d)\n",
+    TRACE("hmenu=%p flags=0x%08x (%d,%d) hwnd=%p (%d,%d)-(%d,%d)\n",
 	    hmenu, wFlags, x, y, hwnd, (lprect) ? lprect->left : 0, (lprect) ?
lprect->top : 0,
 	    (lprect) ? lprect->right : 0,  (lprect) ? lprect->bottom : 0);
 
@@ -2968,7 +2968,7 @@
  */
 static BOOL MENU_InitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT
wFlags)
 {
-    TRACE("hwnd=0x%04x hmenu=0x%04x\n", hWnd, hMenu);
+    TRACE("hwnd=%p hmenu=%p\n", hWnd, hMenu);
 
     HideCaret(0);
 
@@ -2997,7 +2997,7 @@
  */
 static BOOL MENU_ExitTracking(HWND hWnd)
 {
-    TRACE("hwnd=0x%04x\n", hWnd);
+    TRACE("hwnd=%p\n", hWnd);
 
     SendMessageA( hWnd, WM_EXITMENULOOP, 0, 0 );
     ShowCaret(0);
@@ -3014,7 +3014,7 @@
     HMENU hMenu = (ht == HTSYSMENU) ? get_win_sys_menu( hWnd ) :
GetMenu( hWnd );
     UINT wFlags = TPM_ENTERIDLEEX | TPM_BUTTONDOWN | TPM_LEFTALIGN |
TPM_LEFTBUTTON;
 
-    TRACE("wnd=%x ht=0x%04x (%ld,%ld)\n", hWnd, ht, pt.x, pt.y);
+    TRACE("wnd=%p ht=0x%04x (%ld,%ld)\n", hWnd, ht, pt.x, pt.y);
 
     if (IsMenu(hMenu))
     {
@@ -3131,7 +3131,7 @@
  */
 static LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM
wParam, LPARAM lParam )
 {
-    TRACE("hwnd=0x%04x msg=0x%04x wp=0x%04x lp=0x%08lx\n",
+    TRACE("hwnd=%p msg=0x%04x wp=0x%04x lp=0x%08lx\n",
     hwnd, message, wParam, lParam);
 
     switch(message)
@@ -3199,7 +3199,7 @@
     RECT rectBar;
     LPPOPUPMENU lppop;
 
-    TRACE("HWND 0x%x, width %d, at (%d, %d).\n",
+    TRACE("HWND %p, width %d, at (%d, %d).\n",
           hwnd, menubarWidth, orgX, orgY );
 
     if (!(lppop = MENU_GetMenu( GetMenu(hwnd) ))) return 0;
@@ -3219,7 +3219,7 @@
 BOOL WINAPI ChangeMenuA( HMENU hMenu, UINT pos, LPCSTR data,
                              UINT id, UINT flags )
 {
-    TRACE("menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n",
+    TRACE("menu=%p pos=%d data=%08lx id=%08x flags=%08x\n",
                   hMenu, pos, (DWORD)data, id, flags );
     if (flags & MF_APPEND) return AppendMenuA( hMenu, flags &
~MF_APPEND,
                                                  id, data );
@@ -3240,7 +3240,7 @@
 BOOL WINAPI ChangeMenuW( HMENU hMenu, UINT pos, LPCWSTR data,
                              UINT id, UINT flags )
 {
-    TRACE("menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n",
+    TRACE("menu=%p pos=%d data=%08lx id=%08x flags=%08x\n",
                   hMenu, pos, (DWORD)data, id, flags );
     if (flags & MF_APPEND) return AppendMenuW( hMenu, flags &
~MF_APPEND,
                                                  id, data );
@@ -3263,7 +3263,7 @@
     MENUITEM *item;
     DWORD ret;
 
-    TRACE("menu=%04x id=%04x flags=%04x\n", hMenu, id, flags );
+    TRACE("menu=%p id=%04x flags=%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;
@@ -3281,7 +3281,7 @@
     MENUITEM *item;
     POPUPMENU *menu;
 
-    TRACE("(%04x, %04X, %04X) !\n",
+    TRACE("(%p, %04X, %04X) !\n",
 		 hMenu, wItemID, wFlags);
 
     /* Get the Popupmenu to access the owner menu */
@@ -3328,7 +3328,7 @@
 ) {
     MENUITEM *item;
 
-    TRACE("menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
+    TRACE("menu=%p item=%04x ptr=%p len=%d flags=%04x\n",
                  hMenu, wItemID, str, nMaxSiz, wFlags );
     if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0;
     if (!IS_STRING_ITEM(item->fType)) return 0;
@@ -3349,7 +3349,7 @@
 {
     MENUITEM *item;
 
-    TRACE("menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
+    TRACE("menu=%p item=%04x ptr=%p len=%d flags=%04x\n",
                  hMenu, wItemID, str, nMaxSiz, wFlags );
     if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0;
     if (!IS_STRING_ITEM(item->fType)) return 0;
@@ -3367,7 +3367,7 @@
                                 UINT wHilite )
 {
     LPPOPUPMENU menu;
-    TRACE("(%04x, %04x, %04x, %04x);\n",
+    TRACE("(%p, %p, %04x, %04x);\n",
                  hWnd, hMenu, wItemID, wHilite);
     if (!MENU_FindItem( &hMenu, &wItemID, wHilite )) return FALSE;
     if (!(menu = MENU_GetMenu(hMenu))) return FALSE;
@@ -3384,7 +3384,7 @@
 UINT WINAPI GetMenuState( HMENU hMenu, UINT wItemID, UINT wFlags )
 {
     MENUITEM *item;
-    TRACE("(menu=%04x, id=%04x, flags=%04x);\n",
+    TRACE("(menu=%p, id=%04x, flags=%04x);\n",
 		 hMenu, wItemID, wFlags);
     if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return -1;
     debug_print_menuitem ("  item: ", item, "");
@@ -3411,7 +3411,7 @@
 {
     LPPOPUPMENU	menu = MENU_GetMenu(hMenu);
     if (!menu) return -1;
-    TRACE("(%04x) returning %d\n",
+    TRACE("(%p) returning %d\n",
                   hMenu, menu->nItems );
     return menu->nItems;
 }
@@ -3440,10 +3440,10 @@
     MENUITEM *item;
 
     if (IS_STRING_ITEM(flags) && str)
-        TRACE("hMenu %04x, pos %d, flags %08x, "
+        TRACE("hMenu %p, pos %d, flags %08x, "
 		      "id %04x, str %s\n",
                       hMenu, pos, flags, id, debugstr_w(str) );
-    else TRACE("hMenu %04x, pos %d, flags %08x, "
+    else TRACE("hMenu %p, pos %d, flags %08x, "
 		       "id %04x, str %08lx (not a string)\n",
                        hMenu, pos, flags, id, (DWORD)str );
 
@@ -3515,7 +3515,7 @@
     LPPOPUPMENU	menu;
     MENUITEM *item;
 
-    TRACE("(menu=%04x pos=%04x flags=%04x)\n",hMenu, nPos, wFlags);
+    TRACE("(menu=%p pos=%04x flags=%04x)\n",hMenu, nPos, wFlags);
     if (!(item = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE;
     if (!(menu = MENU_GetMenu(hMenu))) return FALSE;
 
@@ -3567,13 +3567,13 @@
 
     if (IS_STRING_ITEM(flags))
     {
-	TRACE("%04x %d %04x %04x %s\n",
+	TRACE("%p %d %04x %04x %s\n",
                       hMenu, pos, flags, id, debugstr_w(str) );
         if (!str) return FALSE;
     }
     else
     {
-	TRACE("%04x %d %04x %04x %08lx\n",
+	TRACE("%p %d %04x %04x %08lx\n",
                       hMenu, pos, flags, id, (DWORD)str );
     }
 
@@ -3639,7 +3639,7 @@
                                     HBITMAP hNewUnCheck, HBITMAP
hNewCheck)
 {
     MENUITEM *item;
-    TRACE("(%04x, %04x, %04x, %04x, %04x)\n",
+    TRACE("(%p, %04x, %04x, %p, %p)\n",
                  hMenu, nPos, wFlags, hNewCheck, hNewUnCheck);
     if (!(item = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE;
 
@@ -3672,7 +3672,7 @@
     menu->FocusedItem = NO_SELECTED_ITEM;
     menu->bTimeToHide = FALSE;
 
-    TRACE("return %04x\n", hMenu );
+    TRACE("return %p\n", hMenu );
 
     return hMenu;
 }
@@ -3683,7 +3683,7 @@
  */
 BOOL WINAPI DestroyMenu( HMENU hMenu )
 {
-    TRACE("(%04x)\n", hMenu);
+    TRACE("(%p)\n", hMenu);
 
     /* Silently ignore attempts to destroy default system popup */
 
@@ -3745,7 +3745,7 @@
 		}
 		else
 		{
-		   WARN("Current sys-menu (%04x) of wnd %04x is broken\n",
+		   WARN("Current sys-menu (%p) of wnd %p is broken\n",
 			wndPtr->hSysMenu, hWnd);
 		   wndPtr->hSysMenu = 0;
 		}
@@ -3796,7 +3796,7 @@
 HMENU WINAPI GetMenu( HWND hWnd )
 {
     HMENU retvalue = (HMENU)GetWindowLongA( hWnd, GWL_ID );
-    TRACE("for %04x returning %04x\n", hWnd, retvalue);
+    TRACE("for %p returning %p\n", hWnd, retvalue);
     return retvalue;
 }
 
@@ -3806,11 +3806,11 @@
  */
 BOOL WINAPI SetMenu( HWND hWnd, HMENU hMenu )
 {
-    TRACE("(%04x, %04x);\n", hWnd, hMenu);
+    TRACE("(%p, %p);\n", hWnd, hMenu);
 
     if (hMenu && !IsMenu(hMenu))
     {
-        WARN("hMenu %x is not a menu handle\n", hMenu);
+        WARN("hMenu %p is not a menu handle\n", hMenu);
         return FALSE;
     }
     if (GetWindowLongA( hWnd, GWL_STYLE ) & WS_CHILD) return FALSE;
@@ -3827,7 +3827,7 @@
         lpmenu->hWnd = hWnd;
         lpmenu->Height = 0;  /* Make sure we recalculate the size */
     }
-    SetWindowLongA( hWnd, GWL_ID, hMenu );
+    SetWindowLongA( hWnd, GWL_ID, HMENU_16(hMenu));
 
     if (IsWindowVisible(hWnd))
         SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
@@ -3879,7 +3879,7 @@
  */
 DWORD WINAPI DrawMenuBarTemp(HWND someHWND, HDC someHDC, LPRECT
someRECT, HMENU someHMENU, HFONT someFONT)
 {
-    FIXME("(0x%08x, 0x%08x, %p, 0x%08x, 0x%08x): stub\n", someHWND,
someHDC, someRECT, someHMENU, someFONT);
+    FIXME("(0x%p, 0x%p, %p, 0x%p, 0x%p): stub\n", someHWND, someHDC,
someRECT, someHMENU, someFONT);
     return 0;
 }
 
@@ -3909,10 +3909,13 @@
  */
 HMENU16 WINAPI LookupMenuHandle16( HMENU16 hmenu, INT16 id )
 {
-    HMENU hmenu32 = hmenu;
+    HMENU hmenu32 = HMENU_32(hmenu);
     UINT id32 = id;
-    if (!MENU_FindItem( &hmenu32, &id32, MF_BYCOMMAND )) return 0;
-    else return hmenu32;
+    if (!MENU_FindItem( &hmenu32, &id32, MF_BYCOMMAND )) {
+	    return 0;
+    } else {
+	    return hmenu;
+    }
 }
 
 
@@ -3964,7 +3967,7 @@
  */
 HMENU16 WINAPI LoadMenuIndirect16( LPCVOID template )
 {
-    HMENU16 hMenu;
+    HMENU hMenu;
     WORD version, offset;
     LPCSTR p = (LPCSTR)template;
 
@@ -3984,7 +3987,7 @@
         DestroyMenu( hMenu );
         return 0;
     }
-    return hMenu;
+    return HMENU_16( hMenu );
 }
 
 
@@ -3993,7 +3996,7 @@
  */
 HMENU WINAPI LoadMenuIndirectA( LPCVOID template )
 {
-    HMENU16 hMenu;
+    HMENU hMenu;
     WORD version, offset;
     LPCSTR p = (LPCSTR)template;
 
@@ -4301,7 +4304,7 @@
 	POPUPMENU *menu;
 	MENUITEM *item;
 
-	TRACE("(0x%x,%d,%d)\n", hmenu, uItem, bypos);
+	TRACE("(%p,%d,%d)\n", hmenu, uItem, bypos);
 
 	if (!(menu = MENU_GetMenu(hmenu))) return FALSE;
 
@@ -4349,7 +4352,7 @@
 	MENUITEM * item;
 	UINT i = 0;
 
-	TRACE("(0x%x,%d,%d)\n", hmenu, bypos, flags);
+	TRACE("(%p,%d,%d)\n", hmenu, bypos, flags);
 
 	if (!(menu = MENU_GetMenu(hmenu))) return -1;
 
@@ -4414,8 +4417,8 @@
      MENUITEM *mifirst, *milast, *micheck;
      HMENU mfirst = hMenu, mlast = hMenu, mcheck = hMenu;
 
-     TRACE("ox%x: %d-%d, check %d, bypos=%d\n",
-		  hMenu, first, last, check, bypos);
+     TRACE("%p: %d-%d, check %d, bypos=%d\n",
+	   hMenu, first, last, check, bypos);
 
      mifirst = MENU_FindItem (&mfirst, &first, bypos);
      milast = MENU_FindItem (&mlast, &last, bypos);
@@ -4458,7 +4461,7 @@
      MENUITEM *item;
      HWND referenceHwnd;
 
-     TRACE("(0x%x,0x%x,%d,%p)\n", hwnd, hMenu, uItem, rect);
+     TRACE("(%p,%p,%d,%p)\n", hwnd, hMenu, uItem, rect);
 
      item = MENU_FindItem (&hMenu, &uItem, MF_BYPOSITION);
      referenceHwnd = hwnd;
@@ -4496,7 +4499,7 @@
 {
     POPUPMENU *menu;
 
-    TRACE("(0x%04x %p)\n", hMenu, lpmi);
+    TRACE("(%p %p)\n", hMenu, lpmi);
 
     if (lpmi && (lpmi->cbSize==sizeof(MENUINFO)) && (menu =
MENU_GetMenu(hMenu)))
     {
@@ -4531,7 +4534,7 @@
 BOOL WINAPI GetMenuInfo (HMENU hMenu, LPMENUINFO lpmi)
 {   POPUPMENU *menu;
 
-    TRACE("(0x%04x %p)\n", hMenu, lpmi);
+    TRACE("(%p %p)\n", hMenu, lpmi);
 
     if (lpmi && (menu = MENU_GetMenu(hMenu)))
     {
@@ -4564,7 +4567,7 @@
 {
     LPPOPUPMENU menu;
 
-    TRACE("(0x%04x 0x%08lx)\n", hMenu, dwContextHelpID);
+    TRACE("(%p 0x%08lx)\n", hMenu, dwContextHelpID);
 
     if ((menu = MENU_GetMenu(hMenu)))
     {
@@ -4582,7 +4585,7 @@
 {
     LPPOPUPMENU menu;
 
-    TRACE("(0x%04x)\n", hMenu);
+    TRACE("(%p)\n", hMenu);
 
     if ((menu = MENU_GetMenu(hMenu)))
     {
@@ -4677,7 +4680,7 @@
             if(hSubMenu != hSysMenu)
             {
                 nPos = MENU_FindSubMenu(&hSysMenu, hSubMenu);
-                TRACE_(accel)("hSysMenu = %04x, hSubMenu = %04x, nPos =
%d\n", hSysMenu, hSubMenu, nPos);
+                TRACE_(accel)("hSysMenu = %p, hSubMenu = %p, nPos =
%d\n", hSysMenu, hSubMenu, nPos);
                 SendMessageA(hWnd, WM_INITMENUPOPUP, (WPARAM)hSubMenu,
MAKELPARAM(nPos, TRUE));
             }
             uSysStat = GetMenuState(GetSubMenu(hSysMenu, 0), cmd,
MF_BYCOMMAND);
@@ -4692,7 +4695,7 @@
                 if(hSubMenu != hMenu)
                 {
                     nPos = MENU_FindSubMenu(&hMenu, hSubMenu);
-                    TRACE_(accel)("hMenu = %04x, hSubMenu = %04x, nPos
= %d\n", hMenu, hSubMenu, nPos);
+                    TRACE_(accel)("hMenu = %p, hSubMenu = %p, nPos =
%d\n", hMenu, hSubMenu, nPos);
                     SendMessageA(hWnd, WM_INITMENUPOPUP,
(WPARAM)hSubMenu, MAKELPARAM(nPos, FALSE));
                 }
                 uStat = GetMenuState(hMenu, cmd, MF_BYCOMMAND);
@@ -4771,7 +4774,7 @@
     }
     if (!hAccel || !(lpAccelTbl = (LPACCEL16)
LockResource16(HACCEL_16(hAccel))))
     {
-        WARN_(accel)("invalid accel handle=%x\n", hAccel);
+        WARN_(accel)("invalid accel handle=%p\n", hAccel);
         return 0;
     }
     if ((msg->message != WM_KEYDOWN &&
@@ -4780,8 +4783,8 @@
          msg->message != WM_SYSKEYUP &&
          msg->message != WM_CHAR)) return 0;
 
-    TRACE_(accel)("TranslateAccelerators hAccel=%04x, hWnd=%04x,"
-                  "msg->hwnd=%04x, msg->message=%04x, wParam=%08x,
lParam=%lx\n",
+    TRACE_(accel)("TranslateAccelerators hAccel=%p, hWnd=%p,"
+                  "msg->hwnd=%p, msg->message=%04x, wParam=%08x,
lParam=%lx\n",
                  
hAccel,hWnd,msg->hwnd,msg->message,msg->wParam,msg->lParam);
 
     i = 0;
Index: controls/scroll.c
===================================================================
RCS file: /home/wine/wine/controls/scroll.c,v
retrieving revision 1.57
diff -u -u -r1.57 scroll.c
--- controls/scroll.c	22 Nov 2002 04:47:10 -0000	1.57
+++ controls/scroll.c	22 Nov 2002 20:44:00 -0000
@@ -973,7 +973,7 @@
           return;  /* Should never happen */
     }
 
-    TRACE("Event: hwnd=%04x bar=%d msg=%s pt=%ld,%ld hit=%d\n",
+    TRACE("Event: hwnd=%p bar=%d msg=%s pt=%ld,%ld hit=%d\n",
           hwnd, nBar, SPY_GetMsgName(msg,hwnd), pt.x, pt.y, hittest );
 
     switch(SCROLL_trackHitTest)
@@ -1236,7 +1236,7 @@
             }
         }
         if (!hUpArrow) SCROLL_LoadBitmaps();
-        TRACE("ScrollBar creation, hwnd=%04x\n", hwnd );
+        TRACE("ScrollBar creation, hwnd=%p\n", hwnd );
         return 0;
 
     case WM_ENABLE:
@@ -1464,7 +1464,7 @@
 
     if (TRACE_ON(scroll))
     {
-        TRACE("hwnd=%04x bar=%d", hwnd, nBar);
+        TRACE("hwnd=%p bar=%d", hwnd, nBar);
         if (info->fMask & SIF_PAGE) DPRINTF( " page=%d", info->nPage );
         if (info->fMask & SIF_POS) DPRINTF( " pos=%d", info->nPos );
         if (info->fMask & SIF_RANGE) DPRINTF( " min=%d max=%d",
info->nMin, info->nMax );
@@ -1761,7 +1761,7 @@
 {
     LONG style = GetWindowLongW( hwnd, GWL_STYLE );
 
-    TRACE("hwnd=%04x bar=%d horz=%d, vert=%d\n",
+    TRACE("hwnd=%p bar=%d horz=%d, vert=%d\n",
                     hwnd, nBar, fShowH, fShowV );
 
     switch(nBar)
@@ -1842,7 +1842,7 @@
     BOOL bFineWithMe;
     SCROLLBAR_INFO *infoPtr;
 
-    TRACE("%04x %d %d\n", hwnd, nBar, flags );
+    TRACE("%p %d %d\n", hwnd, nBar, flags );
 
     flags &= ESB_DISABLE_BOTH;
 
Index: controls/uitools.c
===================================================================
RCS file: /home/wine/wine/controls/uitools.c,v
retrieving revision 1.29
diff -u -u -r1.29 uitools.c
--- controls/uitools.c	30 Oct 2002 23:45:39 -0000	1.29
+++ controls/uitools.c	22 Nov 2002 20:44:01 -0000
@@ -580,7 +580,7 @@
  */
 BOOL WINAPI DrawEdge( HDC hdc, LPRECT rc, UINT edge, UINT flags )
 {
-    TRACE("%04x %d,%d-%d,%d %04x %04x\n",
+    TRACE("%p %d,%d-%d,%d %04x %04x\n",
 	  hdc, rc->left, rc->top, rc->right, rc->bottom, edge, flags );
 
     if(flags & BF_DIAGONAL)
@@ -1392,7 +1392,7 @@
     case DFC_SCROLL:
       return UITOOLS95_DrawFrameScroll(hdc, rc, uState);
     default:
-      WARN("(%x,%p,%d,%x), bad type!\n",
+      WARN("(%p,%p,%d,%x), bad type!\n",
 	   hdc,rc,uType,uState );
     }
     return FALSE;
Index: include/winuser.h
===================================================================
RCS file: /home/wine/wine/include/winuser.h,v
retrieving revision 1.153
diff -u -u -r1.153 winuser.h
--- include/winuser.h	18 Nov 2002 19:46:34 -0000	1.153
+++ include/winuser.h	22 Nov 2002 20:44:04 -0000
@@ -1967,17 +1967,17 @@
 #define MIIM_BITMAP      0x00000080
 #define MIIM_FTYPE       0x00000100
 
-#define HBMMENU_CALLBACK	((HBITMAP) -1)
-#define HBMMENU_SYSTEM		((HBITMAP)  1)
-#define HBMMENU_MBAR_RESTORE	((HBITMAP)  2)
-#define HBMMENU_MBAR_MINIMIZE	((HBITMAP)  3)
-#define HBMMENU_MBAR_CLOSE	((HBITMAP)  5)
-#define HBMMENU_MBAR_CLOSE_D	((HBITMAP)  6)
-#define HBMMENU_MBAR_MINIMIZE_D	((HBITMAP)  7)
-#define HBMMENU_POPUP_CLOSE	((HBITMAP)  8)
-#define HBMMENU_POPUP_RESTORE	((HBITMAP)  9)
-#define HBMMENU_POPUP_MAXIMIZE	((HBITMAP) 10)
-#define HBMMENU_POPUP_MINIMIZE	((HBITMAP) 11)
+#define HBMMENU_CALLBACK	         -1
+#define HBMMENU_SYSTEM		          1
+#define HBMMENU_MBAR_RESTORE	          2
+#define HBMMENU_MBAR_MINIMIZE	          3
+#define HBMMENU_MBAR_CLOSE	          5
+#define HBMMENU_MBAR_CLOSE_D	          6
+#define HBMMENU_MBAR_MINIMIZE_D           7
+#define HBMMENU_POPUP_CLOSE	          8
+#define HBMMENU_POPUP_RESTORE	          9
+#define HBMMENU_POPUP_MAXIMIZE	         10
+#define HBMMENU_POPUP_MINIMIZE	         11
 
 /* WM_H/VSCROLL commands */
 #define SB_LINEUP           0
Index: include/wownt32.h
===================================================================
RCS file: /home/wine/wine/include/wownt32.h,v
retrieving revision 1.6
diff -u -u -r1.6 wownt32.h
--- include/wownt32.h	18 Oct 2002 23:35:24 -0000	1.6
+++ include/wownt32.h	22 Nov 2002 20:44:04 -0000
@@ -81,6 +81,12 @@
 #define HPALETTE_32(h16)  ((HPALETTE)  (ULONG_PTR)(h16))
 #define HPEN_32(h16)      ((HPEN)      (ULONG_PTR)(h16))
 #define HACCEL_32(h16)    ((HACCEL)    (ULONG_PTR)(h16))
+#define HINSTANCE_32(h16) ((HINSTANCE) (ULONG_PTR)(h16))
+#define HANDLE_32(h16)    ((HANDLE)    (ULONG_PTR)(h16))
+#define HGDIOBJ_32(h16)   ((HGDIOBJ)   (ULONG_PTR)(h16))
+#define HMODULE_32(h16)   ((HMODULE)   (ULONG_PTR)(h16))
+#define HGLOBAL_32(h16)   ((HGLOBAL)   (ULONG_PTR)(h16))
+#define HUSER_32(h16)     ((HGLOBAL)   (ULONG_PTR)(h16))
 
 #define HWND_16(h32)      (LOWORD(h32))
 #define HMENU_16(h32)     (LOWORD(h32))
@@ -94,6 +100,12 @@
 #define HPALETTE_16(h32)  (LOWORD(h32))
 #define HPEN_16(h32)      (LOWORD(h32))
 #define HACCEL_16(h32)    (LOWORD(h32))
+#define HINSTANCE_16(h32) (LOWORD(h32))
+#define HANDLE_16(h32)    (LOWORD(h32))
+#define HGDIOBJ_16(h32)   (LOWORD(h32))
+#define HMODULE_16(h32)   (LOWORD(h32))
+#define HGLOBAL_16(h32)   (LOWORD(h32))
+#define HUSER_16(h32)     (LOWORD(h32))
 
 #else  /* __WINE__ */
 

-- 
Johan Dahlin <jdahlin at async.com.br>
Async Open Source




More information about the wine-patches mailing list