2000-02-18 03:38:33 +08:00
|
|
|
/* strace.cc: system/windows tracing
|
|
|
|
|
2002-06-05 12:01:43 +08:00
|
|
|
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
This file is part of Cygwin.
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
2000-08-03 00:28:18 +08:00
|
|
|
#include "winsup.h"
|
2000-02-18 03:38:33 +08:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <time.h>
|
2000-07-28 01:30:51 +08:00
|
|
|
#include <wingdi.h>
|
|
|
|
#include <winuser.h>
|
2000-08-03 03:26:01 +08:00
|
|
|
#include <ctype.h>
|
2002-10-23 00:18:55 +08:00
|
|
|
#include <errno.h>
|
2000-08-12 13:35:42 +08:00
|
|
|
#include "pinfo.h"
|
2002-01-29 10:02:03 +08:00
|
|
|
#include "perprocess.h"
|
|
|
|
#include "cygwin_version.h"
|
2002-02-16 01:06:40 +08:00
|
|
|
#include "hires.h"
|
2002-10-23 00:18:55 +08:00
|
|
|
#include "security.h"
|
2002-08-02 00:20:31 +08:00
|
|
|
#include "cygthread.h"
|
2002-10-23 00:18:55 +08:00
|
|
|
#include "fhandler.h"
|
|
|
|
#include "path.h"
|
|
|
|
#include "dtable.h"
|
|
|
|
#include "cygerrno.h"
|
|
|
|
#include "cygheap.h"
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2002-09-23 08:31:31 +08:00
|
|
|
#define PROTECT(x) x[sizeof (x)-1] = 0
|
|
|
|
#define CHECK(x) if (x[sizeof (x)-1] != 0) { small_printf ("array bound exceeded %d\n", __LINE__); ExitProcess (1); }
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2002-06-19 23:27:27 +08:00
|
|
|
class strace NO_COPY strace;
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
#ifndef NOSTRACE
|
|
|
|
|
2002-01-29 10:02:03 +08:00
|
|
|
void
|
2002-09-22 11:38:57 +08:00
|
|
|
strace::hello ()
|
2002-01-29 10:02:03 +08:00
|
|
|
{
|
|
|
|
char buf[30];
|
2002-02-15 05:20:06 +08:00
|
|
|
|
|
|
|
if (inited)
|
|
|
|
{
|
|
|
|
active ^= 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2002-06-06 09:26:33 +08:00
|
|
|
inited = 1;
|
2002-05-27 10:25:28 +08:00
|
|
|
if (!being_debugged ())
|
|
|
|
return;
|
|
|
|
|
2002-01-29 10:02:03 +08:00
|
|
|
__small_sprintf (buf, "cYg%8x %x", _STRACE_INTERFACE_ACTIVATE_ADDR, &active);
|
|
|
|
OutputDebugString (buf);
|
|
|
|
|
|
|
|
if (active)
|
|
|
|
{
|
|
|
|
prntf (1, NULL, "**********************************************");
|
2002-07-14 05:08:13 +08:00
|
|
|
prntf (1, NULL, "Program name: %s (%d)", myself->progname, myself->pid ?: GetCurrentProcessId ());
|
2002-01-29 10:02:03 +08:00
|
|
|
prntf (1, NULL, "App version: %d.%d, api: %d.%d",
|
|
|
|
user_data->dll_major, user_data->dll_minor,
|
|
|
|
user_data->api_major, user_data->api_minor);
|
|
|
|
prntf (1, NULL, "DLL version: %d.%d, api: %d.%d",
|
|
|
|
cygwin_version.dll_major, cygwin_version.dll_minor,
|
|
|
|
cygwin_version.api_major, cygwin_version.api_minor);
|
|
|
|
prntf (1, NULL, "DLL build: %s", cygwin_version.dll_build_date);
|
|
|
|
prntf (1, NULL, "OS version: Windows %s", wincap.osname ());
|
2002-10-23 00:18:55 +08:00
|
|
|
prntf (1, NULL, "Heap size: %u", cygheap->user_heap.chunk);
|
2002-01-29 10:02:03 +08:00
|
|
|
prntf (1, NULL, "**********************************************");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-03-07 13:33:09 +08:00
|
|
|
int
|
2002-02-16 01:06:40 +08:00
|
|
|
strace::microseconds ()
|
2000-02-18 03:38:33 +08:00
|
|
|
{
|
2002-06-07 11:44:33 +08:00
|
|
|
static hires_us now;
|
2002-02-16 01:06:40 +08:00
|
|
|
return (int) now.usecs (true);
|
2000-02-18 03:38:33 +08:00
|
|
|
}
|
|
|
|
|
2000-08-03 03:26:01 +08:00
|
|
|
static int __stdcall
|
|
|
|
getfunc (char *in_dst, const char *func)
|
|
|
|
{
|
|
|
|
const char *p;
|
|
|
|
const char *pe;
|
|
|
|
char *dst = in_dst;
|
|
|
|
for (p = func; (pe = strchr (p, '(')); p = pe + 1)
|
|
|
|
if (isalnum ((int)pe[-1]) || pe[-1] == '_')
|
|
|
|
break;
|
2002-09-23 08:31:31 +08:00
|
|
|
else if (isspace ((int)pe[-1]))
|
2000-08-03 03:26:01 +08:00
|
|
|
{
|
|
|
|
pe--;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (!pe)
|
|
|
|
pe = strchr (func, '\0');
|
|
|
|
for (p = pe; p > func; p--)
|
|
|
|
if (p != pe && *p == ' ')
|
|
|
|
{
|
|
|
|
p++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (*p == '*')
|
|
|
|
p++;
|
|
|
|
while (p < pe)
|
|
|
|
*dst++ = *p++;
|
|
|
|
|
|
|
|
*dst++ = ':';
|
|
|
|
*dst++ = ' ';
|
|
|
|
*dst = '\0';
|
|
|
|
|
|
|
|
return dst - in_dst;
|
|
|
|
}
|
|
|
|
|
2000-10-08 02:12:11 +08:00
|
|
|
extern "C" char *__progname;
|
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
/* sprintf analog for use by output routines. */
|
2000-03-07 13:33:09 +08:00
|
|
|
int
|
2000-08-03 03:26:01 +08:00
|
|
|
strace::vsprntf (char *buf, const char *func, const char *infmt, va_list ap)
|
2000-02-18 03:38:33 +08:00
|
|
|
{
|
|
|
|
int count;
|
2000-02-28 13:05:33 +08:00
|
|
|
char fmt[80];
|
2000-10-13 06:15:47 +08:00
|
|
|
static NO_COPY int nonewline = FALSE;
|
2000-02-18 03:38:33 +08:00
|
|
|
DWORD err = GetLastError ();
|
2002-08-02 00:20:31 +08:00
|
|
|
const char *tn = cygthread::name ();
|
2002-09-19 11:30:20 +08:00
|
|
|
char *pn = __progname ?: (myself ? myself->progname : NULL);
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2000-03-07 13:33:09 +08:00
|
|
|
int microsec = microseconds ();
|
2000-02-18 03:38:33 +08:00
|
|
|
lmicrosec = microsec;
|
|
|
|
|
2000-02-28 13:05:33 +08:00
|
|
|
__small_sprintf (fmt, "%7d [%s] %s ", microsec, tn, "%s %d%s");
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
SetLastError (err);
|
2000-08-03 03:26:01 +08:00
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
if (nonewline)
|
2000-08-03 03:26:01 +08:00
|
|
|
count = 0;
|
2000-02-18 03:38:33 +08:00
|
|
|
else
|
|
|
|
{
|
2000-10-08 02:12:11 +08:00
|
|
|
char *p, progname[MAX_PATH + 1];
|
2000-10-13 06:15:47 +08:00
|
|
|
if (!pn)
|
|
|
|
p = (char *) "*** unknown ***";
|
|
|
|
else if ((p = strrchr (pn, '\\')) != NULL)
|
2000-10-08 02:12:11 +08:00
|
|
|
p++;
|
|
|
|
else if ((p = strrchr (pn, '/')) != NULL)
|
2000-02-28 13:05:33 +08:00
|
|
|
p++;
|
2000-02-18 03:38:33 +08:00
|
|
|
else
|
2000-10-08 02:12:11 +08:00
|
|
|
p = pn;
|
2000-02-28 13:05:33 +08:00
|
|
|
strcpy (progname, p);
|
2000-10-18 02:55:58 +08:00
|
|
|
if ((p = strrchr (progname, '.')) != NULL && strcasematch (p, ".exe"))
|
2000-02-28 13:05:33 +08:00
|
|
|
*p = '\000';
|
|
|
|
p = progname;
|
2002-07-14 05:08:13 +08:00
|
|
|
count = __small_sprintf (buf, fmt, p && *p ? p : "?",
|
|
|
|
myself->pid ?: GetCurrentProcessId (),
|
2000-10-24 10:25:27 +08:00
|
|
|
execing ? "!" : "");
|
2000-08-03 03:26:01 +08:00
|
|
|
if (func)
|
|
|
|
count += getfunc (buf + count, func);
|
2000-02-18 03:38:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
count += __small_vsprintf (buf + count, infmt, ap);
|
|
|
|
char *p;
|
|
|
|
for (p = buf + count; p > buf; p--)
|
|
|
|
switch (p[-1])
|
|
|
|
{
|
|
|
|
case '\n':
|
|
|
|
p[-1] = '\0';
|
|
|
|
break;
|
|
|
|
case '\b':
|
|
|
|
*--p = '\0';
|
|
|
|
nonewline = TRUE;
|
|
|
|
goto done;
|
|
|
|
default:
|
|
|
|
goto addnl;
|
|
|
|
}
|
|
|
|
|
|
|
|
addnl:
|
|
|
|
*p++ = '\n';
|
|
|
|
*p = '\0';
|
|
|
|
nonewline = FALSE;
|
|
|
|
|
|
|
|
done:
|
|
|
|
return p - buf;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Write to strace file or strace queue. */
|
2000-03-07 13:33:09 +08:00
|
|
|
void
|
|
|
|
strace::write (unsigned category, const char *buf, int count)
|
2000-02-18 03:38:33 +08:00
|
|
|
{
|
|
|
|
# define PREFIX (3 + 8 + 1 + 8 + 1)
|
|
|
|
char outbuf[PREFIX + 1 + count + 1];
|
|
|
|
# define outstuff (outbuf + 12)
|
|
|
|
__small_sprintf (outstuff, "%x %s", category, buf);
|
|
|
|
__small_sprintf (outbuf, "cYg%08x", strlen (outstuff) + 1);
|
|
|
|
outstuff[-1] = ' ';
|
|
|
|
OutputDebugString (outbuf);
|
2000-10-24 10:25:27 +08:00
|
|
|
#undef outstuff
|
|
|
|
#undef PREFIX
|
2000-02-18 03:38:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Printf function used when tracing system calls.
|
|
|
|
Warning: DO NOT SET ERRNO HERE! */
|
|
|
|
|
|
|
|
void
|
2001-02-26 17:50:24 +08:00
|
|
|
strace::vprntf (unsigned category, const char *func, const char *fmt, va_list ap)
|
2000-02-18 03:38:33 +08:00
|
|
|
{
|
|
|
|
DWORD err = GetLastError ();
|
2000-08-02 11:42:31 +08:00
|
|
|
int count;
|
|
|
|
char buf[10000];
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2002-09-22 11:38:57 +08:00
|
|
|
PROTECT (buf);
|
2000-08-02 11:42:31 +08:00
|
|
|
SetLastError (err);
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2000-08-03 03:26:01 +08:00
|
|
|
count = this->vsprntf (buf, func, fmt, ap);
|
2002-09-22 11:38:57 +08:00
|
|
|
CHECK (buf);
|
2000-08-02 11:42:31 +08:00
|
|
|
if (category & _STRACE_SYSTEM)
|
|
|
|
{
|
|
|
|
DWORD done;
|
|
|
|
WriteFile (GetStdHandle (STD_ERROR_HANDLE), buf, count, &done, 0);
|
|
|
|
FlushFileBuffers (GetStdHandle (STD_ERROR_HANDLE));
|
2000-02-18 03:38:33 +08:00
|
|
|
}
|
2000-08-02 11:42:31 +08:00
|
|
|
|
|
|
|
#ifndef NOSTRACE
|
|
|
|
if (active)
|
|
|
|
this->write (category, buf, count);
|
|
|
|
#endif
|
2000-02-18 03:38:33 +08:00
|
|
|
SetLastError (err);
|
|
|
|
}
|
|
|
|
|
2001-02-26 17:50:24 +08:00
|
|
|
void
|
|
|
|
strace::prntf (unsigned category, const char *func, const char *fmt, ...)
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
va_start (ap, fmt);
|
|
|
|
this->vprntf (category, func, fmt, ap);
|
|
|
|
}
|
|
|
|
|
|
|
|
extern "C" void
|
|
|
|
strace_printf (unsigned category, const char *func, const char *fmt, ...)
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
if ((category & _STRACE_SYSTEM) || strace.active)
|
|
|
|
{
|
|
|
|
va_start (ap, fmt);
|
|
|
|
strace.vprntf (category, func, fmt, ap);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-10-13 09:35:15 +08:00
|
|
|
static NO_COPY struct tab
|
2000-02-18 03:38:33 +08:00
|
|
|
{
|
|
|
|
int v;
|
|
|
|
const char *n;
|
|
|
|
}
|
|
|
|
ta[] =
|
|
|
|
{
|
|
|
|
{ WM_NULL, "WM_NULL" },
|
|
|
|
{ WM_CREATE, "WM_CREATE" },
|
|
|
|
{ WM_DESTROY, "WM_DESTROY" },
|
|
|
|
{ WM_MOVE, "WM_MOVE" },
|
|
|
|
{ WM_SIZE, "WM_SIZE" },
|
|
|
|
{ WM_ACTIVATE, "WM_ACTIVATE" },
|
|
|
|
{ WM_SETFOCUS, "WM_SETFOCUS" },
|
|
|
|
{ WM_KILLFOCUS, "WM_KILLFOCUS" },
|
|
|
|
{ WM_ENABLE, "WM_ENABLE" },
|
|
|
|
{ WM_SETREDRAW, "WM_SETREDRAW" },
|
|
|
|
{ WM_SETTEXT, "WM_SETTEXT" },
|
|
|
|
{ WM_GETTEXT, "WM_GETTEXT" },
|
|
|
|
{ WM_GETTEXTLENGTH, "WM_GETTEXTLENGTH" },
|
|
|
|
{ WM_PAINT, "WM_PAINT" },
|
|
|
|
{ WM_CLOSE, "WM_CLOSE" },
|
|
|
|
{ WM_QUERYENDSESSION, "WM_QUERYENDSESSION" },
|
|
|
|
{ WM_QUIT, "WM_QUIT" },
|
|
|
|
{ WM_QUERYOPEN, "WM_QUERYOPEN" },
|
|
|
|
{ WM_ERASEBKGND, "WM_ERASEBKGND" },
|
|
|
|
{ WM_SYSCOLORCHANGE, "WM_SYSCOLORCHANGE" },
|
|
|
|
{ WM_ENDSESSION, "WM_ENDSESSION" },
|
|
|
|
{ WM_SHOWWINDOW, "WM_SHOWWINDOW" },
|
|
|
|
{ WM_WININICHANGE, "WM_WININICHANGE" },
|
|
|
|
{ WM_DEVMODECHANGE, "WM_DEVMODECHANGE" },
|
|
|
|
{ WM_ACTIVATEAPP, "WM_ACTIVATEAPP" },
|
|
|
|
{ WM_FONTCHANGE, "WM_FONTCHANGE" },
|
|
|
|
{ WM_TIMECHANGE, "WM_TIMECHANGE" },
|
|
|
|
{ WM_CANCELMODE, "WM_CANCELMODE" },
|
|
|
|
{ WM_SETCURSOR, "WM_SETCURSOR" },
|
|
|
|
{ WM_MOUSEACTIVATE, "WM_MOUSEACTIVATE" },
|
|
|
|
{ WM_CHILDACTIVATE, "WM_CHILDACTIVATE" },
|
|
|
|
{ WM_QUEUESYNC, "WM_QUEUESYNC" },
|
|
|
|
{ WM_GETMINMAXINFO, "WM_GETMINMAXINFO" },
|
|
|
|
{ WM_PAINTICON, "WM_PAINTICON" },
|
|
|
|
{ WM_ICONERASEBKGND, "WM_ICONERASEBKGND" },
|
|
|
|
{ WM_NEXTDLGCTL, "WM_NEXTDLGCTL" },
|
|
|
|
{ WM_SPOOLERSTATUS, "WM_SPOOLERSTATUS" },
|
|
|
|
{ WM_DRAWITEM, "WM_DRAWITEM" },
|
|
|
|
{ WM_MEASUREITEM, "WM_MEASUREITEM" },
|
|
|
|
{ WM_DELETEITEM, "WM_DELETEITEM" },
|
|
|
|
{ WM_VKEYTOITEM, "WM_VKEYTOITEM" },
|
|
|
|
{ WM_CHARTOITEM, "WM_CHARTOITEM" },
|
|
|
|
{ WM_SETFONT, "WM_SETFONT" },
|
|
|
|
{ WM_GETFONT, "WM_GETFONT" },
|
|
|
|
{ WM_SETHOTKEY, "WM_SETHOTKEY" },
|
|
|
|
{ WM_GETHOTKEY, "WM_GETHOTKEY" },
|
|
|
|
{ WM_QUERYDRAGICON, "WM_QUERYDRAGICON" },
|
|
|
|
{ WM_COMPAREITEM, "WM_COMPAREITEM" },
|
|
|
|
{ WM_COMPACTING, "WM_COMPACTING" },
|
|
|
|
{ WM_WINDOWPOSCHANGING, "WM_WINDOWPOSCHANGING" },
|
|
|
|
{ WM_WINDOWPOSCHANGED, "WM_WINDOWPOSCHANGED" },
|
|
|
|
{ WM_POWER, "WM_POWER" },
|
|
|
|
{ WM_COPYDATA, "WM_COPYDATA" },
|
|
|
|
{ WM_CANCELJOURNAL, "WM_CANCELJOURNAL" },
|
|
|
|
{ WM_NCCREATE, "WM_NCCREATE" },
|
|
|
|
{ WM_NCDESTROY, "WM_NCDESTROY" },
|
|
|
|
{ WM_NCCALCSIZE, "WM_NCCALCSIZE" },
|
|
|
|
{ WM_NCHITTEST, "WM_NCHITTEST" },
|
|
|
|
{ WM_NCPAINT, "WM_NCPAINT" },
|
|
|
|
{ WM_NCACTIVATE, "WM_NCACTIVATE" },
|
|
|
|
{ WM_GETDLGCODE, "WM_GETDLGCODE" },
|
|
|
|
{ WM_NCMOUSEMOVE, "WM_NCMOUSEMOVE" },
|
|
|
|
{ WM_NCLBUTTONDOWN, "WM_NCLBUTTONDOWN" },
|
|
|
|
{ WM_NCLBUTTONUP, "WM_NCLBUTTONUP" },
|
|
|
|
{ WM_NCLBUTTONDBLCLK, "WM_NCLBUTTONDBLCLK" },
|
|
|
|
{ WM_NCRBUTTONDOWN, "WM_NCRBUTTONDOWN" },
|
|
|
|
{ WM_NCRBUTTONUP, "WM_NCRBUTTONUP" },
|
|
|
|
{ WM_NCRBUTTONDBLCLK, "WM_NCRBUTTONDBLCLK" },
|
|
|
|
{ WM_NCMBUTTONDOWN, "WM_NCMBUTTONDOWN" },
|
|
|
|
{ WM_NCMBUTTONUP, "WM_NCMBUTTONUP" },
|
|
|
|
{ WM_NCMBUTTONDBLCLK, "WM_NCMBUTTONDBLCLK" },
|
|
|
|
{ WM_KEYFIRST, "WM_KEYFIRST" },
|
|
|
|
{ WM_KEYDOWN, "WM_KEYDOWN" },
|
|
|
|
{ WM_KEYUP, "WM_KEYUP" },
|
|
|
|
{ WM_CHAR, "WM_CHAR" },
|
|
|
|
{ WM_DEADCHAR, "WM_DEADCHAR" },
|
|
|
|
{ WM_SYSKEYDOWN, "WM_SYSKEYDOWN" },
|
|
|
|
{ WM_SYSKEYUP, "WM_SYSKEYUP" },
|
|
|
|
{ WM_SYSCHAR, "WM_SYSCHAR" },
|
|
|
|
{ WM_SYSDEADCHAR, "WM_SYSDEADCHAR" },
|
|
|
|
{ WM_KEYLAST, "WM_KEYLAST" },
|
|
|
|
{ WM_INITDIALOG, "WM_INITDIALOG" },
|
|
|
|
{ WM_COMMAND, "WM_COMMAND" },
|
|
|
|
{ WM_SYSCOMMAND, "WM_SYSCOMMAND" },
|
|
|
|
{ WM_TIMER, "WM_TIMER" },
|
|
|
|
{ WM_HSCROLL, "WM_HSCROLL" },
|
|
|
|
{ WM_VSCROLL, "WM_VSCROLL" },
|
|
|
|
{ WM_INITMENU, "WM_INITMENU" },
|
|
|
|
{ WM_INITMENUPOPUP, "WM_INITMENUPOPUP" },
|
|
|
|
{ WM_MENUSELECT, "WM_MENUSELECT" },
|
|
|
|
{ WM_MENUCHAR, "WM_MENUCHAR" },
|
|
|
|
{ WM_ENTERIDLE, "WM_ENTERIDLE" },
|
|
|
|
{ WM_CTLCOLORMSGBOX, "WM_CTLCOLORMSGBOX" },
|
|
|
|
{ WM_CTLCOLOREDIT, "WM_CTLCOLOREDIT" },
|
|
|
|
{ WM_CTLCOLORLISTBOX, "WM_CTLCOLORLISTBOX" },
|
|
|
|
{ WM_CTLCOLORBTN, "WM_CTLCOLORBTN" },
|
|
|
|
{ WM_CTLCOLORDLG, "WM_CTLCOLORDLG" },
|
|
|
|
{ WM_CTLCOLORSCROLLBAR, "WM_CTLCOLORSCROLLBAR" },
|
|
|
|
{ WM_CTLCOLORSTATIC, "WM_CTLCOLORSTATIC" },
|
|
|
|
{ WM_MOUSEFIRST, "WM_MOUSEFIRST" },
|
|
|
|
{ WM_MOUSEMOVE, "WM_MOUSEMOVE" },
|
|
|
|
{ WM_LBUTTONDOWN, "WM_LBUTTONDOWN" },
|
|
|
|
{ WM_LBUTTONUP, "WM_LBUTTONUP" },
|
|
|
|
{ WM_LBUTTONDBLCLK, "WM_LBUTTONDBLCLK" },
|
|
|
|
{ WM_RBUTTONDOWN, "WM_RBUTTONDOWN" },
|
|
|
|
{ WM_RBUTTONUP, "WM_RBUTTONUP" },
|
|
|
|
{ WM_RBUTTONDBLCLK, "WM_RBUTTONDBLCLK" },
|
|
|
|
{ WM_MBUTTONDOWN, "WM_MBUTTONDOWN" },
|
|
|
|
{ WM_MBUTTONUP, "WM_MBUTTONUP" },
|
|
|
|
{ WM_MBUTTONDBLCLK, "WM_MBUTTONDBLCLK" },
|
|
|
|
{ WM_MOUSELAST, "WM_MOUSELAST" },
|
|
|
|
{ WM_PARENTNOTIFY, "WM_PARENTNOTIFY" },
|
|
|
|
{ WM_ENTERMENULOOP, "WM_ENTERMENULOOP" },
|
|
|
|
{ WM_EXITMENULOOP, "WM_EXITMENULOOP" },
|
|
|
|
{ WM_MDICREATE, "WM_MDICREATE" },
|
|
|
|
{ WM_MDIDESTROY, "WM_MDIDESTROY" },
|
|
|
|
{ WM_MDIACTIVATE, "WM_MDIACTIVATE" },
|
|
|
|
{ WM_MDIRESTORE, "WM_MDIRESTORE" },
|
|
|
|
{ WM_MDINEXT, "WM_MDINEXT" },
|
|
|
|
{ WM_MDIMAXIMIZE, "WM_MDIMAXIMIZE" },
|
|
|
|
{ WM_MDITILE, "WM_MDITILE" },
|
|
|
|
{ WM_MDICASCADE, "WM_MDICASCADE" },
|
|
|
|
{ WM_MDIICONARRANGE, "WM_MDIICONARRANGE" },
|
|
|
|
{ WM_MDIGETACTIVE, "WM_MDIGETACTIVE" },
|
|
|
|
{ WM_MDISETMENU, "WM_MDISETMENU" },
|
|
|
|
{ WM_DROPFILES, "WM_DROPFILES" },
|
|
|
|
{ WM_MDIREFRESHMENU, "WM_MDIREFRESHMENU" },
|
|
|
|
{ WM_CUT, "WM_CUT" },
|
|
|
|
{ WM_COPY, "WM_COPY" },
|
|
|
|
{ WM_PASTE, "WM_PASTE" },
|
|
|
|
{ WM_CLEAR, "WM_CLEAR" },
|
|
|
|
{ WM_UNDO, "WM_UNDO" },
|
|
|
|
{ WM_RENDERFORMAT, "WM_RENDERFORMAT" },
|
|
|
|
{ WM_RENDERALLFORMATS, "WM_RENDERALLFORMATS" },
|
|
|
|
{ WM_DESTROYCLIPBOARD, "WM_DESTROYCLIPBOARD" },
|
|
|
|
{ WM_DRAWCLIPBOARD, "WM_DRAWCLIPBOARD" },
|
|
|
|
{ WM_PAINTCLIPBOARD, "WM_PAINTCLIPBOARD" },
|
|
|
|
{ WM_VSCROLLCLIPBOARD, "WM_VSCROLLCLIPBOARD" },
|
|
|
|
{ WM_SIZECLIPBOARD, "WM_SIZECLIPBOARD" },
|
|
|
|
{ WM_ASKCBFORMATNAME, "WM_ASKCBFORMATNAME" },
|
|
|
|
{ WM_CHANGECBCHAIN, "WM_CHANGECBCHAIN" },
|
|
|
|
{ WM_HSCROLLCLIPBOARD, "WM_HSCROLLCLIPBOARD" },
|
|
|
|
{ WM_QUERYNEWPALETTE, "WM_QUERYNEWPALETTE" },
|
|
|
|
{ WM_PALETTEISCHANGING, "WM_PALETTEISCHANGING" },
|
|
|
|
{ WM_PALETTECHANGED, "WM_PALETTECHANGED" },
|
|
|
|
{ WM_HOTKEY, "WM_HOTKEY" },
|
|
|
|
{ WM_PENWINFIRST, "WM_PENWINFIRST" },
|
|
|
|
{ WM_PENWINLAST, "WM_PENWINLAST" },
|
|
|
|
{ WM_ASYNCIO, "ASYNCIO" },
|
|
|
|
{ 0, 0 }};
|
|
|
|
|
2000-03-07 13:33:09 +08:00
|
|
|
void
|
|
|
|
strace::wm (int message, int word, int lon)
|
2000-02-18 03:38:33 +08:00
|
|
|
{
|
2000-03-07 13:33:09 +08:00
|
|
|
if (active)
|
2000-02-18 03:38:33 +08:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; ta[i].n; i++)
|
|
|
|
{
|
|
|
|
if (ta[i].v == message)
|
|
|
|
{
|
2000-08-03 03:26:01 +08:00
|
|
|
this->prntf (_STRACE_WM, NULL, "wndproc %d %s %d %d", message, ta[i].n, word, lon);
|
2000-02-18 03:38:33 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2000-08-03 03:26:01 +08:00
|
|
|
this->prntf (_STRACE_WM, NULL, "wndproc %d unknown %d %d", message, word, lon);
|
2000-02-18 03:38:33 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif /*NOSTRACE*/
|