Converted to the new debugging interface (done with the help of the
script written by Patrik Stridvall).
diff --git a/windows/win.c b/windows/win.c
index 7989457..c81a247 100644
--- a/windows/win.c
+++ b/windows/win.c
@@ -28,7 +28,7 @@
#include "task.h"
#include "thread.h"
#include "process.h"
-#include "debug.h"
+#include "debugtools.h"
#include "winerror.h"
#include "mdi.h"
#include "local.h"
@@ -137,7 +137,7 @@
if (ptr->dwMagic != WND_MAGIC) goto error;
if (ptr->hwndSelf != hwnd)
{
- ERR( win, "Can't happen: hwnd %04x self pointer is %04x\n",hwnd, ptr->hwndSelf );
+ ERR_(win)("Can't happen: hwnd %04x self pointer is %04x\n",hwnd, ptr->hwndSelf );
goto error;
}
/* returns a locked pointer */
@@ -195,7 +195,7 @@
else if(wndPtr->irefCount < 0)
{
/* This else if is useful to monitor the WIN_ReleaseWndPtr function */
- TRACE(win,"forgot a Lock on %p somewhere\n",wndPtr);
+ TRACE_(win)("forgot a Lock on %p somewhere\n",wndPtr);
}
/*unlock all WND structures for thread safeness*/
WIN_UnlockWnds();
@@ -229,15 +229,15 @@
if (!(ptr = WIN_FindWndPtr( hwnd )))
{
- WARN( win, "%04x is not a window handle\n", hwnd );
+ WARN_(win)("%04x is not a window handle\n", hwnd );
return;
}
if (!GetClassNameA( hwnd, className, sizeof(className ) ))
strcpy( className, "#NULL#" );
- TRACE( win, "Window %04x (%p):\n", hwnd, ptr );
- DUMP( "next=%p child=%p parent=%p owner=%p class=%p '%s'\n"
+ TRACE_(win)("Window %04x (%p):\n", hwnd, ptr );
+ DPRINTF( "next=%p child=%p parent=%p owner=%p class=%p '%s'\n"
"inst=%04x taskQ=%04x updRgn=%04x active=%04x dce=%p idmenu=%08x\n"
"style=%08lx exstyle=%08lx wndproc=%08x text='%s'\n"
"client=%d,%d-%d,%d window=%d,%d-%d,%d"
@@ -254,12 +254,12 @@
if (ptr->class->cbWndExtra)
{
- DUMP( "extra bytes:" );
+ DPRINTF( "extra bytes:" );
for (i = 0; i < ptr->class->cbWndExtra; i++)
- DUMP( " %02x", *((BYTE*)ptr->wExtra+i) );
- DUMP( "\n" );
+ DPRINTF( " %02x", *((BYTE*)ptr->wExtra+i) );
+ DPRINTF( "\n" );
}
- DUMP( "\n" );
+ DPRINTF( "\n" );
WIN_ReleaseWndPtr(ptr);
}
@@ -278,22 +278,22 @@
if (!ptr)
{
- WARN( win, "Invalid window handle %04x\n", hwnd );
+ WARN_(win)("Invalid window handle %04x\n", hwnd );
return;
}
if (!indent) /* first time around */
- DUMP( "%-16.16s %-8.8s %-6.6s %-17.17s %-8.8s %s\n",
+ DPRINTF( "%-16.16s %-8.8s %-6.6s %-17.17s %-8.8s %s\n",
"hwnd", " wndPtr", "queue", "Class Name", " Style", " WndProc"
" Text");
while (ptr)
{
- DUMP( "%*s%04x%*s", indent, "", ptr->hwndSelf, 13-indent,"");
+ DPRINTF( "%*s%04x%*s", indent, "", ptr->hwndSelf, 13-indent,"");
GlobalGetAtomName16(ptr->class->atomName,className,sizeof(className));
- DUMP( "%08lx %-6.4x %-17.17s %08x %08x %.14s\n",
+ DPRINTF( "%08lx %-6.4x %-17.17s %08x %08x %.14s\n",
(DWORD)ptr, ptr->hmemTaskQ, className,
(UINT)ptr->dwStyle, (UINT)ptr->winproc,
ptr->text?ptr->text:"<null>");
@@ -396,7 +396,7 @@
{
if (!(pWnd->dwStyle & WS_VISIBLE))
{
- TRACE(win, "skipping window %04x\n",
+ TRACE_(win)("skipping window %04x\n",
pWnd->hwndSelf );
}
else if ((pWnd->hmemTaskQ == hQueue) &&
@@ -430,7 +430,7 @@
hwndRet = pWnd->hwndSelf;
WIN_ReleaseWndPtr(pWnd);
}
- TRACE(win,"found %04x\n",hwndRet);
+ TRACE_(win)("found %04x\n",hwndRet);
return hwndRet;
}
@@ -446,7 +446,7 @@
HWND hwnd = wndPtr->hwndSelf;
WND *pWnd;
- TRACE(win, "%04x\n", wndPtr->hwndSelf );
+ TRACE_(win)("%04x\n", wndPtr->hwndSelf );
#ifdef CONFIG_IPC
if (main_block)
@@ -602,7 +602,7 @@
HWND hwndDesktop;
DESKTOP *pDesktop;
- TRACE(win,"Creating desktop window\n");
+ TRACE_(win)("Creating desktop window\n");
/* Initialisation of the critical section for thread safeness */
@@ -683,7 +683,7 @@
LRESULT (CALLBACK *localSend32)(HWND, UINT, WPARAM, LPARAM);
char buffer[256];
- TRACE(win, "%s %s %08lx %08lx %d,%d %dx%d %04x %04x %08x %p\n",
+ TRACE_(win)("%s %s %08lx %08lx %d,%d %dx%d %04x %04x %08x %p\n",
unicode ? debugres_w((LPWSTR)cs->lpszName) : debugres_a(cs->lpszName),
unicode ? debugres_w((LPWSTR)cs->lpszClass) : debugres_a(cs->lpszClass),
cs->dwExStyle, cs->style, cs->x, cs->y, cs->cx, cs->cy,
@@ -696,11 +696,11 @@
/* Make sure parent is valid */
if (!IsWindow( cs->hwndParent ))
{
- WARN( win, "Bad parent %04x\n", cs->hwndParent );
+ WARN_(win)("Bad parent %04x\n", cs->hwndParent );
return 0;
}
} else if ((cs->style & WS_CHILD) && !(cs->style & WS_POPUP)) {
- WARN( win, "No parent for child window\n" );
+ WARN_(win)("No parent for child window\n" );
return 0; /* WS_CHILD needs a parent, but WS_POPUP doesn't */
}
@@ -708,7 +708,7 @@
if (!(classPtr = CLASS_FindClassByAtom( classAtom, win32?cs->hInstance:GetExePtr(cs->hInstance) )))
{
GlobalGetAtomNameA( classAtom, buffer, sizeof(buffer) );
- WARN( win, "Bad class '%s'\n", buffer );
+ WARN_(win)("Bad class '%s'\n", buffer );
return 0;
}
@@ -763,7 +763,7 @@
if (!(hwnd = USER_HEAP_ALLOC( sizeof(*wndPtr) + classPtr->cbWndExtra
- sizeof(wndPtr->wExtra) )))
{
- TRACE(win, "out of memory\n" );
+ TRACE_(win)("out of memory\n" );
return 0;
}
@@ -836,7 +836,7 @@
: HOOK_CallHooksA(WH_CBT, HCBT_CREATEWND, hwnd, (LPARAM)&cbtc);
if (ret)
{
- TRACE(win, "CBT-hook returned 0\n");
+ TRACE_(win)("CBT-hook returned 0\n");
wndPtr->pDriver->pFinalize(wndPtr);
USER_HEAP_FREE( hwnd );
retvalue = 0;
@@ -956,7 +956,7 @@
/* send it anyway */
if (((wndPtr->rectClient.right-wndPtr->rectClient.left) <0)
||((wndPtr->rectClient.bottom-wndPtr->rectClient.top)<0))
- WARN(win,"sending bogus WM_SIZE message 0x%08lx\n",
+ WARN_(win)("sending bogus WM_SIZE message 0x%08lx\n",
MAKELONG(wndPtr->rectClient.right-wndPtr->rectClient.left,
wndPtr->rectClient.bottom-wndPtr->rectClient.top));
SendMessageA( hwnd, WM_SIZE, SIZE_RESTORED,
@@ -1002,7 +1002,7 @@
if (!(wndPtr->dwStyle & WS_CHILD) && !wndPtr->owner)
HOOK_CallHooks16( WH_SHELL, HSHELL_WINDOWCREATED, hwnd, 0 );
- TRACE(win, "created window %04x\n", hwnd);
+ TRACE_(win)("created window %04x\n", hwnd);
retvalue = hwnd;
goto end;
}
@@ -1011,7 +1011,7 @@
/* Abort window creation */
- WARN(win, "aborted by WM_xxCREATE!\n");
+ WARN_(win)("aborted by WM_xxCREATE!\n");
WIN_ReleaseWndPtr(WIN_DestroyWindow( wndPtr ));
retvalue = 0;
end:
@@ -1141,11 +1141,11 @@
if (HIWORD(className))
{
LPSTR cn = HEAP_strdupWtoA( GetProcessHeap(), 0, className );
- WARN( win, "Bad class name '%s'\n",cn);
+ WARN_(win)("Bad class name '%s'\n",cn);
HeapFree( GetProcessHeap(), 0, cn );
}
else
- WARN( win, "Bad class name %p\n", className );
+ WARN_(win)("Bad class name %p\n", className );
return 0;
}
@@ -1268,7 +1268,7 @@
WIN_CheckFocus(pWnd);
}
else
- WARN(win, "\tdestroyed itself while in WM_DESTROY!\n");
+ WARN_(win)("\tdestroyed itself while in WM_DESTROY!\n");
}
@@ -1289,7 +1289,7 @@
WND * wndPtr;
BOOL retvalue;
- TRACE(win, "(%04x)\n", hwnd);
+ TRACE_(win)("(%04x)\n", hwnd);
/* Initialization */
@@ -1561,7 +1561,7 @@
{
ATOM atom = 0;
- TRACE(win, "%04x %04x '%s' '%s'\n", parent,
+ TRACE_(win)("%04x %04x '%s' '%s'\n", parent,
child, HIWORD(className)?(char *)PTR_SEG_TO_LIN(className):"",
title ? title : "");
@@ -1709,7 +1709,7 @@
WND *wndPtr;
BOOL retvalue;
- TRACE(win,"EnableWindow32: ( %x, %d )\n", hwnd, enable);
+ TRACE_(win)("EnableWindow32: ( %x, %d )\n", hwnd, enable);
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return FALSE;
if (enable && (wndPtr->dwStyle & WS_DISABLED))
@@ -1814,7 +1814,7 @@
{
if (offset + sizeof(WORD) > wndPtr->class->cbWndExtra)
{
- WARN( win, "Invalid offset %d\n", offset );
+ WARN_(win)("Invalid offset %d\n", offset );
retvalue = 0;
goto end;
}
@@ -1825,7 +1825,7 @@
{
case GWW_ID:
if (HIWORD(wndPtr->wIDmenu))
- WARN( win,"GWW_ID: discards high bits of 0x%08x!\n",
+ WARN_(win)("GWW_ID: discards high bits of 0x%08x!\n",
wndPtr->wIDmenu);
retvalue = (WORD)wndPtr->wIDmenu;
goto end;
@@ -1834,12 +1834,12 @@
goto end;
case GWW_HINSTANCE:
if (HIWORD(wndPtr->hInstance))
- WARN(win,"GWW_HINSTANCE: discards high bits of 0x%08x!\n",
+ WARN_(win)("GWW_HINSTANCE: discards high bits of 0x%08x!\n",
wndPtr->hInstance);
retvalue = (WORD)wndPtr->hInstance;
goto end;
default:
- WARN( win, "Invalid offset %d\n", offset );
+ WARN_(win)("Invalid offset %d\n", offset );
retvalue = 0;
goto end;
}
@@ -1884,7 +1884,7 @@
{
if (offset + sizeof(WORD) > wndPtr->class->cbWndExtra)
{
- WARN( win, "Invalid offset %d\n", offset );
+ WARN_(win)("Invalid offset %d\n", offset );
retval = 0;
goto end;
}
@@ -1897,7 +1897,7 @@
case GWW_HWNDPARENT: retval = SetParent( hwnd, newval );
goto end;
default:
- WARN( win, "Invalid offset %d\n", offset );
+ WARN_(win)("Invalid offset %d\n", offset );
retval = 0;
goto end;
}
@@ -1923,7 +1923,7 @@
{
if (offset + sizeof(LONG) > wndPtr->class->cbWndExtra)
{
- WARN( win, "Invalid offset %d\n", offset );
+ WARN_(win)("Invalid offset %d\n", offset );
retvalue = 0;
goto end;
}
@@ -1954,7 +1954,7 @@
case GWL_HINSTANCE: retvalue = wndPtr->hInstance;
goto end;
default:
- WARN( win, "Unknown offset %d\n", offset );
+ WARN_(win)("Unknown offset %d\n", offset );
}
retvalue = 0;
end:
@@ -1981,7 +1981,7 @@
WND * wndPtr = WIN_FindWndPtr( hwnd );
STYLESTRUCT style;
- TRACE(win,"%x=%p %x %lx %x\n",hwnd, wndPtr, offset, newval, type);
+ TRACE_(win)("%x=%p %x %lx %x\n",hwnd, wndPtr, offset, newval, type);
if (!wndPtr)
{
@@ -1994,7 +1994,7 @@
{
if (offset + sizeof(LONG) > wndPtr->class->cbWndExtra)
{
- WARN( win, "Invalid offset %d\n", offset );
+ WARN_(win)("Invalid offset %d\n", offset );
/* Is this the right error? */
SetLastError( ERROR_OUTOFMEMORY );
@@ -2053,7 +2053,7 @@
goto end;
default:
- WARN( win, "Invalid offset %d\n", offset );
+ WARN_(win)("Invalid offset %d\n", offset );
/* Don't think this is right error but it should do */
SetLastError( ERROR_OUTOFMEMORY );
@@ -2221,7 +2221,7 @@
*/
INT WINAPI InternalGetWindowText(HWND hwnd,LPWSTR lpString,INT nMaxCount )
{
- FIXME(win,"(0x%08x,%p,0x%x),stub!\n",hwnd,lpString,nMaxCount);
+ FIXME_(win)("(0x%08x,%p,0x%x),stub!\n",hwnd,lpString,nMaxCount);
return GetWindowTextW(hwnd,lpString,nMaxCount);
}
@@ -2981,7 +2981,7 @@
{
WND *wndPtr = WIN_FindWndPtr(hWnd);
- TRACE(win,"%04x\n", hWnd);
+ TRACE_(win)("%04x\n", hWnd);
if (!wndPtr) return FALSE;
@@ -3026,7 +3026,7 @@
{
HWND hWndOldModal = hwndSysModal;
hwndSysModal = hWnd;
- FIXME(win, "EMPTY STUB !! SetSysModalWindow(%04x) !\n", hWnd);
+ FIXME_(win)("EMPTY STUB !! SetSysModalWindow(%04x) !\n", hWnd);
return hWndOldModal;
}
@@ -3120,7 +3120,7 @@
if(ptrWnd)
{
- TRACE(msg,"hwnd = %04x, %d %d - %d %d\n",
+ TRACE_(msg)("hwnd = %04x, %d %d - %d %d\n",
ptrWnd->hwndSelf, ptrWnd->rectWindow.left, ptrWnd->rectWindow.top,
ptrWnd->rectWindow.right, ptrWnd->rectWindow.bottom );
if( !(ptrWnd->dwStyle & WS_DISABLED) )
@@ -3272,7 +3272,7 @@
lpDragInfo->pt = msg.pt;
/* update DRAGINFO struct */
- TRACE(msg,"lpDI->hScope = %04x\n",lpDragInfo->hScope);
+ TRACE_(msg)("lpDI->hScope = %04x\n",lpDragInfo->hScope);
if( DRAG_QueryUpdate(hwndScope, spDragInfo, FALSE) > 0 )
hCurrentCursor = hCursor;