ReactOS 0.4.17-dev-1321-g5c122a9
spy.c File Reference
#include <user32.h>
#include <wine/commctrl.h>
#include <commdlg.h>
#include <richedit.h>
#include <prsht.h>
Include dependency graph for spy.c:

Go to the source code of this file.

Classes

struct  USER_MSG
 
struct  CONTROL_CLASS
 
struct  SPY_NOTIFY
 
struct  SPY_INSTANCE
 

Macros

#define SPY_MAX_MSGNUM   WM_USER
 
#define SPY_INDENT_UNIT   4 /* 4 spaces */
 
#define DEBUG_SPY   0
 
#define SPY_MAX_LVMMSGNUM   182
 
#define SPY_MAX_TVMSGNUM   65
 
#define SPY_MAX_HDMMSGNUM   19
 
#define SPY_MAX_TCMMSGNUM   62
 
#define SPY_MAX_PGMMSGNUM   13
 
#define SPY_MAX_CCMMSGNUM   9
 
#define SPY_MAX_WINEMSGNUM   (WM_WINE_SETPIXELFORMAT - WM_WINE_DESTROYWINDOW)
 
#define SPY_MAX_WINE_DRIVER_MSGNUM   (WM_WINE_SETCURSOR - WM_WINE_CLIPCURSOR)
 
#define SPY_MAX_VKKEYSNUM   255
 
#define USM(a, b)   { #a ,a,b}
 
#define SZOF(a)   sizeof(a)
 
#define RB_GETBANDINFO_OLD   (WM_USER+5) /* obsoleted after IE3, but we have to support it anyway */
 
#define SPNFY(a, b)   { #a ,a,sizeof(b)-sizeof(NMHDR)}
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (message)
 
static BOOL exclude_msg (UINT msg)
 
static BOOL exclude_dwp (void)
 
static INT_PTR get_indent_level (void)
 
static void set_indent_level (INT_PTR level)
 
static const char * SPY_GetMsgInternal (UINT msg)
 
static const USER_MSG * SPY_Bsearch_Msg (const USER_MSG *msgs, UINT count, UINT code)
 
static void SPY_GetClassName (SPY_INSTANCE *sp_e)
 
static void SPY_GetMsgStuff (SPY_INSTANCE *sp_e)
 
static void SPY_GetWndName (SPY_INSTANCE *sp_e)
 
const char * SPY_GetMsgName (UINT msg, HWND hWnd)
 
const char * SPY_GetVKeyName (WPARAM wParam)
 
static const SPY_NOTIFY * SPY_Bsearch_Notify (UINT code)
 
static void SPY_DumpMem (LPCSTR header, const UINT *q, INT len)
 
static void SPY_DumpStructure (const SPY_INSTANCE *sp_e, BOOL enter)
 
static BOOL spy_init (void)
 
void SPY_EnterMessage (INT iFlag, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
void SPY_ExitMessage (INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn, WPARAM wParam, LPARAM lParam)
 

Variables

static const char *const MessageTypeNames [SPY_MAX_MSGNUM+1]
 
static const char *const LVMMessageTypeNames [SPY_MAX_LVMMSGNUM+1]
 
static const char *const TVMessageTypeNames [SPY_MAX_TVMSGNUM+1]
 
static const char *const HDMMessageTypeNames [SPY_MAX_HDMMSGNUM+1]
 
static const char *const TCMMessageTypeNames [SPY_MAX_TCMMSGNUM+1]
 
static const char *const PGMMessageTypeNames [SPY_MAX_PGMMSGNUM+1]
 
static const char *const CCMMessageTypeNames [SPY_MAX_CCMMSGNUM+1]
 
static const char *const WINEMessageTypeNames [SPY_MAX_WINEMSGNUM+1]
 
static const char *const wine_driver_message_type_names [SPY_MAX_WINE_DRIVER_MSGNUM+1]
 
static const char *const VK_KeyNames [SPY_MAX_VKKEYSNUM+1]
 
static const USER_MSG rebar_array []
 
static const USER_MSG toolbar_array []
 
static const USER_MSG tooltips_array []
 
static const USER_MSG comboex_array []
 
static const USER_MSG propsht_array []
 
static const USER_MSG updown_array []
 
static const USER_MSG richedit_array []
 
static const CONTROL_CLASS cc_array []
 
static const SPY_NOTIFY spnfy_array []
 
static unsigned char * spy_exclude
 

Macro Definition Documentation

◆ DEBUG_SPY

#define DEBUG_SPY   0

Definition at line 34 of file spy.c.

◆ RB_GETBANDINFO_OLD

#define RB_GETBANDINFO_OLD   (WM_USER+5) /* obsoleted after IE3, but we have to support it anyway */

Definition at line 1444 of file spy.c.

◆ SPNFY

#define SPNFY (   a,
  b 
)    { #a ,a,sizeof(b)-sizeof(NMHDR)}

Definition at line 1788 of file spy.c.

◆ SPY_INDENT_UNIT

#define SPY_INDENT_UNIT   4 /* 4 spaces */

Definition at line 32 of file spy.c.

◆ SPY_MAX_CCMMSGNUM

#define SPY_MAX_CCMMSGNUM   9

Definition at line 1111 of file spy.c.

◆ SPY_MAX_HDMMSGNUM

#define SPY_MAX_HDMMSGNUM   19

Definition at line 997 of file spy.c.

◆ SPY_MAX_LVMMSGNUM

#define SPY_MAX_LVMMSGNUM   182

Definition at line 736 of file spy.c.

◆ SPY_MAX_MSGNUM

#define SPY_MAX_MSGNUM   WM_USER

Definition at line 31 of file spy.c.

◆ SPY_MAX_PGMMSGNUM

#define SPY_MAX_PGMMSGNUM   13

Definition at line 1091 of file spy.c.

◆ SPY_MAX_TCMMSGNUM

#define SPY_MAX_TCMMSGNUM   62

Definition at line 1023 of file spy.c.

◆ SPY_MAX_TVMSGNUM

#define SPY_MAX_TVMSGNUM   65

Definition at line 925 of file spy.c.

◆ SPY_MAX_VKKEYSNUM

#define SPY_MAX_VKKEYSNUM   255

Definition at line 1155 of file spy.c.

◆ SPY_MAX_WINE_DRIVER_MSGNUM

#define SPY_MAX_WINE_DRIVER_MSGNUM   (WM_WINE_SETCURSOR - WM_WINE_CLIPCURSOR)

Definition at line 1146 of file spy.c.

◆ SPY_MAX_WINEMSGNUM

#define SPY_MAX_WINEMSGNUM   (WM_WINE_SETPIXELFORMAT - WM_WINE_DESTROYWINDOW)

Definition at line 1127 of file spy.c.

◆ SZOF

#define SZOF (   a)    sizeof(a)

Definition at line 1438 of file spy.c.

◆ USM

#define USM (   a,
  b 
)    { #a ,a,b}

Definition at line 1437 of file spy.c.

Function Documentation

◆ exclude_dwp()

static BOOL exclude_dwp ( void  )
inlinestatic

Definition at line 2017 of file spy.c.

2018{
2019 return spy_exclude[SPY_MAX_MSGNUM + 1];
2020}
#define SPY_MAX_MSGNUM
Definition: spy.c:31
static unsigned char * spy_exclude
Definition: spy.c:2010

Referenced by SPY_EnterMessage(), and SPY_ExitMessage().

◆ exclude_msg()

static BOOL exclude_msg ( UINT  msg)
inlinestatic

Definition at line 2012 of file spy.c.

2013{
2014 return spy_exclude[ min( msg, SPY_MAX_MSGNUM ) ];
2015}
#define msg(x)
Definition: auth_time.c:54
#define min(a, b)
Definition: monoChain.cc:55

Referenced by SPY_EnterMessage(), and SPY_ExitMessage().

◆ get_indent_level()

static INT_PTR get_indent_level ( void  )
inlinestatic

Definition at line 2042 of file spy.c.

2043{
2044#ifdef __REACTOS__
2045 return (INT_PTR)TlsGetValue( indent_tls_index );
2046#else
2047 return get_user_thread_info()->spy_indent;
2048#endif
2049}
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1301
int32_t INT_PTR
Definition: typedefs.h:64

Referenced by SPY_EnterMessage(), and SPY_ExitMessage().

◆ set_indent_level()

static void set_indent_level ( INT_PTR  level)
inlinestatic

Definition at line 2055 of file spy.c.

2056{
2057#ifdef __REACTOS__
2058 TlsSetValue( indent_tls_index, (void *)level );
2059#else
2060 get_user_thread_info()->spy_indent = level;
2061#endif
2062}
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
Definition: thread.c:1337
GLint level
Definition: gl.h:1546

Referenced by SPY_EnterMessage(), and SPY_ExitMessage().

◆ SPY_Bsearch_Msg()

static const USER_MSG * SPY_Bsearch_Msg ( const USER_MSG *  msgs,
UINT  count,
UINT  code 
)
static

Definition at line 2103 of file spy.c.

2104{
2105 int low = 0, high = count - 1;
2106
2107 while (low <= high)
2108 {
2109 int idx = (low + high) / 2;
2110 if (msgs[idx].value == code) return msgs + idx;
2111 if (msgs[idx].value > code)
2112 high = idx - 1;
2113 else
2114 low = idx + 1;
2115 }
2116 return NULL;
2117}
#define NULL
Definition: types.h:112
unsigned int idx
Definition: utils.c:40
GLuint GLuint GLsizei count
Definition: gl.h:1545
Definition: inflate.c:139
Definition: pdh_main.c:64

Referenced by SPY_GetMsgStuff().

◆ SPY_Bsearch_Notify()

static const SPY_NOTIFY * SPY_Bsearch_Notify ( UINT  code)
static

Definition at line 2265 of file spy.c.

2266{
2267 int low = 0, high = ARRAY_SIZE(spnfy_array) - 1;
2268
2269 while (low <= high)
2270 {
2271 int idx = (low + high) / 2;
2272 if (spnfy_array[idx].value == code) return spnfy_array + idx;
2273 if (spnfy_array[idx].value < code)
2274 high = idx - 1;
2275 else
2276 low = idx + 1;
2277 }
2278 return NULL;
2279}
#define ARRAY_SIZE(A)
Definition: main.h:20
static const SPY_NOTIFY spnfy_array[]
Definition: spy.c:1794

Referenced by SPY_DumpStructure().

◆ SPY_DumpMem()

static void SPY_DumpMem ( LPCSTR  header,
const UINT *  q,
INT  len 
)
static

Definition at line 2284 of file spy.c.

2285{
2286 int i;
2287
2288 for(i=0; i<len-12; i+=16) {
2289 TRACE("%s [%04x] %08x %08x %08x %08x\n",
2290 header, i, *q, *(q+1), *(q+2), *(q+3));
2291 q += 4;
2292 }
2293 switch ((len - i + 3) & (~3)) {
2294 case 16:
2295 TRACE("%s [%04x] %08x %08x %08x %08x\n",
2296 header, i, *q, *(q+1), *(q+2), *(q+3));
2297 break;
2298 case 12:
2299 TRACE("%s [%04x] %08x %08x %08x\n",
2300 header, i, *q, *(q+1), *(q+2));
2301 break;
2302 case 8:
2303 TRACE("%s [%04x] %08x %08x\n",
2304 header, i, *q, *(q+1));
2305 break;
2306 case 4:
2307 TRACE("%s [%04x] %08x\n",
2308 header, i, *q);
2309 break;
2310 default:
2311 break;
2312 }
2313}
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by SPY_DumpStructure().

◆ SPY_DumpStructure()

static void SPY_DumpStructure ( const SPY_INSTANCE *  sp_e,
BOOL  enter 
)
static

Definition at line 2318 of file spy.c.

2319{
2320 switch (sp_e->msgnum)
2321 {
2322 case LVM_INSERTITEMW:
2323 case LVM_SETITEMW:
2324 if (!enter) break;
2325 /* fall through */
2326 case LVM_GETITEMW:
2327 {
2328 LPLVITEMA item = (LPLVITEMA) sp_e->lParam;
2329 if (item) {
2330 SPY_DumpMem ("LVITEM", (UINT*)item, sizeof(LVITEMA));
2331 }
2332 break;
2333 }
2334 case TCM_INSERTITEMW:
2335 case TCM_INSERTITEMA:
2336 case TCM_SETITEMW:
2337 case TCM_SETITEMA:
2338 if (!enter) break;
2339 /* fall through */
2340 case TCM_GETITEMW:
2341 case TCM_GETITEMA:
2342 {
2343 TCITEMA *item = (TCITEMA *) sp_e->lParam;
2344 if (item) {
2345 SPY_DumpMem ("TCITEM", (UINT*)item, sizeof(TCITEMA));
2346 }
2347 break;
2348 }
2349 case TCM_ADJUSTRECT:
2350 case LVM_GETITEMRECT:
2351 case LVM_GETSUBITEMRECT:
2352 {
2353 LPRECT rc = (LPRECT) sp_e->lParam;
2354 if (rc)
2355 TRACE("lParam rect (%s)\n", wine_dbgstr_rect(rc));
2356 break;
2357 }
2359 if (!enter) break;
2360 /* fall through */
2362 case LVM_GETORIGIN:
2363 {
2364 LPPOINT point = (LPPOINT) sp_e->lParam;
2365 if (point) {
2366 TRACE("lParam point x=%d, y=%d\n", point->x, point->y);
2367 }
2368 break;
2369 }
2370 case SBM_SETRANGE:
2371 if (!enter && (sp_e->msgnum == SBM_SETRANGE)) break;
2372 TRACE("min=%d max=%ld\n", (int)sp_e->wParam, sp_e->lParam);
2373 break;
2374 case SBM_GETRANGE:
2375 if ((enter && (sp_e->msgnum == SBM_GETRANGE)) ||
2376 (!enter && (sp_e->msgnum == SBM_SETRANGE))) break;
2377 {
2378 LPINT ptmin = (LPINT) sp_e->wParam;
2379 LPINT ptmax = (LPINT) sp_e->lParam;
2380 if (ptmin && ptmax)
2381 TRACE("min=%d max=%d\n", *ptmin, *ptmax);
2382 else if (ptmin)
2383 TRACE("min=%d max=n/a\n", *ptmin);
2384 else if (ptmax)
2385 TRACE("min=n/a max=%d\n", *ptmax);
2386 break;
2387 }
2388 case EM_EXSETSEL:
2389 if (enter && sp_e->lParam)
2390 {
2391 CHARRANGE *cr = (CHARRANGE *) sp_e->lParam;
2392 TRACE("CHARRANGE: cpMin=%d cpMax=%d\n", cr->cpMin, cr->cpMax);
2393 }
2394 break;
2395 case EM_SETCHARFORMAT:
2396 if (enter && sp_e->lParam)
2397 {
2398 CHARFORMATW *cf = (CHARFORMATW *) sp_e->lParam;
2399 TRACE("CHARFORMAT: dwMask=0x%08x dwEffects=", cf->dwMask);
2400 if ((cf->dwMask & CFM_BOLD) && (cf->dwEffects & CFE_BOLD))
2401 TRACE(" CFE_BOLD");
2402 if ((cf->dwMask & CFM_COLOR) && (cf->dwEffects & CFE_AUTOCOLOR))
2403 TRACE(" CFE_AUTOCOLOR");
2404 if ((cf->dwMask & CFM_ITALIC) && (cf->dwEffects & CFE_ITALIC))
2405 TRACE(" CFE_ITALIC");
2406 if ((cf->dwMask & CFM_PROTECTED) && (cf->dwEffects & CFE_PROTECTED))
2407 TRACE(" CFE_PROTECTED");
2408 if ((cf->dwMask & CFM_STRIKEOUT) && (cf->dwEffects & CFE_STRIKEOUT))
2409 TRACE(" CFE_STRIKEOUT");
2410 if ((cf->dwMask & CFM_UNDERLINE) && (cf->dwEffects & CFE_UNDERLINE))
2411 TRACE(" CFE_UNDERLINE");
2412 TRACE("\n");
2413 if (cf->dwMask & CFM_SIZE)
2414 TRACE("yHeight=%d\n", cf->yHeight);
2415 if (cf->dwMask & CFM_OFFSET)
2416 TRACE("yOffset=%d\n", cf->yOffset);
2417 if ((cf->dwMask & CFM_COLOR) && !(cf->dwEffects & CFE_AUTOCOLOR))
2418 TRACE("crTextColor=%x\n", cf->crTextColor);
2419 TRACE("bCharSet=%x bPitchAndFamily=%x\n", cf->bCharSet, cf->bPitchAndFamily);
2420 /* FIXME: we should try to be a bit more intelligent about
2421 * whether this is in ANSI or Unicode (it could be either) */
2422 if (cf->dwMask & CFM_FACE)
2423 TRACE("szFaceName=%s\n", debugstr_wn(cf->szFaceName, LF_FACESIZE));
2424 /* FIXME: handle CHARFORMAT2 too */
2425 }
2426 break;
2427 case WM_DRAWITEM:
2428 if (!enter) break;
2429 {
2430 DRAWITEMSTRUCT *lpdis = (DRAWITEMSTRUCT*) sp_e->lParam;
2431 TRACE("DRAWITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n",
2432 lpdis->CtlType, lpdis->CtlID);
2433 TRACE("itemID=0x%08x itemAction=0x%08x itemState=0x%08x\n",
2434 lpdis->itemID, lpdis->itemAction, lpdis->itemState);
2435 TRACE("hWnd=%p hDC=%p (%s) itemData=0x%08lx\n",
2436 lpdis->hwndItem, lpdis->hDC,
2437 wine_dbgstr_rect(&lpdis->rcItem), lpdis->itemData);
2438 }
2439 break;
2440 case WM_MEASUREITEM:
2441 {
2442 MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*) sp_e->lParam;
2443 TRACE("MEASUREITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n",
2444 lpmis->CtlType, lpmis->CtlID);
2445 TRACE("itemID=0x%08x itemWidth=0x%08x itemHeight=0x%08x\n",
2446 lpmis->itemID, lpmis->itemWidth, lpmis->itemHeight);
2447 TRACE("itemData=0x%08lx\n", lpmis->itemData);
2448 }
2449 break;
2450 case WM_NCCREATE:
2451 case WM_CREATE:
2452 {
2453 BOOL unicode;
2455
2456 if (!enter) break;
2457
2458 unicode = IsWindowUnicode(sp_e->msg_hwnd);
2459 cs = (CREATESTRUCTA *)sp_e->lParam;
2460 TRACE("%s %s ex=%08x style=%08x %d,%d %dx%d parent=%p menu=%p inst=%p params=%p\n",
2461 unicode ? debugstr_w((LPCWSTR)cs->lpszName) : debugstr_a(cs->lpszName),
2462 unicode ? debugstr_w((LPCWSTR)cs->lpszClass) : debugstr_a(cs->lpszClass),
2463 cs->dwExStyle, cs->style, cs->x, cs->y, cs->cx, cs->cy,
2464 cs->hwndParent, cs->hMenu, cs->hInstance, cs->lpCreateParams);
2465 break;
2466 }
2467 case WM_SIZE:
2468 if (!enter) break;
2469 TRACE("cx=%d cy=%d\n", LOWORD(sp_e->lParam), HIWORD(sp_e->lParam));
2470 break;
2472 if (!enter) break;
2474 {
2475 WINDOWPOS *lpwp = (WINDOWPOS *)sp_e->lParam;
2476 TRACE("WINDOWPOS hwnd=%p, after=%p, at (%d,%d) w=%d h=%d, flags=0x%08x\n",
2477 lpwp->hwnd, lpwp->hwndInsertAfter, lpwp->x, lpwp->y,
2478 lpwp->cx, lpwp->cy, lpwp->flags);
2479 }
2480 break;
2481 case WM_STYLECHANGED:
2482 if (!enter) break;
2483 case WM_STYLECHANGING:
2484 {
2486 TRACE("STYLESTRUCT: StyleOld=0x%08x, StyleNew=0x%08x\n",
2487 ss->styleOld, ss->styleNew);
2488 }
2489 break;
2490 case WM_NCCALCSIZE:
2491 if (!sp_e->wParam)
2492 {
2493 RECT *rc = (RECT *)sp_e->lParam;
2494 TRACE("Rect %s\n", wine_dbgstr_rect(rc));
2495 }
2496 else
2497 {
2499 TRACE("Rects %s %s %s\n", wine_dbgstr_rect(nc->rgrc),
2500 wine_dbgstr_rect(nc->rgrc + 1), wine_dbgstr_rect(nc->rgrc + 2));
2501 if (nc->lppos)
2502 TRACE("WINDOWPOS hwnd=%p, after=%p, at (%d,%d) w=%d h=%d, flags=0x%08x\n",
2503 nc->lppos->hwnd, nc->lppos->hwndInsertAfter, nc->lppos->x, nc->lppos->y,
2504 nc->lppos->cx, nc->lppos->cy, nc->lppos->flags);
2505 }
2506 break;
2507 case WM_NOTIFY:
2508 /* if (!enter) break; */
2509 {
2510 NMHDR * pnmh = (NMHDR*) sp_e->lParam;
2511 UINT *q, dumplen;
2512 const SPY_NOTIFY *p;
2513 WCHAR from_class[60];
2514 DWORD save_error;
2515
2516 p = SPY_Bsearch_Notify( pnmh->code );
2517 if (p) {
2518 TRACE("NMHDR hwndFrom=%p idFrom=0x%08lx code=%s<0x%08x>, extra=0x%x\n",
2519 pnmh->hwndFrom, (long)pnmh->idFrom, p->name, pnmh->code, p->len);
2520 dumplen = p->len;
2521
2522 /* for CUSTOMDRAW, dump all the data for TOOLBARs */
2523 if (pnmh->code == NM_CUSTOMDRAW) {
2524 /* save and restore error code over the next call */
2525 save_error = RtlGetLastWin32Error();
2526 GetClassNameW(pnmh->hwndFrom, from_class, ARRAY_SIZE(from_class));
2527 RtlSetLastWin32Error(save_error);
2528 if (wcscmp(TOOLBARCLASSNAMEW, from_class) == 0)
2529 dumplen = sizeof(NMTBCUSTOMDRAW)-sizeof(NMHDR);
2530 } else if ( pnmh->code >= HDN_ENDDRAG
2531 && pnmh->code <= HDN_ITEMCHANGINGA ) {
2532 dumplen = sizeof(NMHEADERA)-sizeof(NMHDR);
2533 }
2534 if (dumplen > 0) {
2535 q = (UINT *)(pnmh + 1);
2536 SPY_DumpMem ("NM extra", q, dumplen);
2537 }
2538 }
2539 else
2540 TRACE("NMHDR hwndFrom=%p idFrom=0x%08lx code=0x%08x\n",
2541 pnmh->hwndFrom, (long)pnmh->idFrom, pnmh->code);
2542 }
2543 break;
2544 default:
2545 if (sp_e->data_len > 0)
2546 SPY_DumpMem ("MSG lParam", (UINT *)sp_e->lParam, sp_e->data_len);
2547 }
2548
2549}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
HINSTANCE hInstance
Definition: charmap.c:19
static HWND hwndParent
Definition: cryptui.c:299
#define LF_FACESIZE
Definition: dimm.idl:39
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
POINTL point
Definition: edittest.c:50
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLfloat GLfloat p
Definition: glext.h:8902
unsigned int UINT
Definition: sysinfo.c:13
#define ss
Definition: i386-dis.c:441
#define cs
Definition: i386-dis.c:442
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_wn
Definition: kernel32.h:33
#define debugstr_w
Definition: kernel32.h:32
if(dx< 0)
Definition: linetemp.h:194
int * LPINT
Definition: minwindef.h:151
#define LOWORD(l)
Definition: pedump.c:82
short WCHAR
Definition: pedump.c:58
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
struct _NMTBCUSTOMDRAW NMTBCUSTOMDRAW
struct tagLVITEMA * LPLVITEMA
#define LVM_GETITEMPOSITION
Definition: commctrl.h:2488
_Out_opt_ int * cx
Definition: commctrl.h:585
#define TCM_INSERTITEMW
Definition: commctrl.h:4052
#define LVM_SETITEMW
Definition: commctrl.h:2402
#define LVM_GETSUBITEMRECT
Definition: commctrl.h:2767
#define TCM_SETITEMA
Definition: commctrl.h:4044
#define TCM_SETITEMW
Definition: commctrl.h:4045
#define HDN_ITEMCHANGINGA
Definition: commctrl.h:837
#define TCM_ADJUSTRECT
Definition: commctrl.h:4090
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define HDN_ENDDRAG
Definition: commctrl.h:856
#define TOOLBARCLASSNAMEW
Definition: commctrl.h:943
#define TCM_GETITEMA
Definition: commctrl.h:4037
#define LVM_GETITEMRECT
Definition: commctrl.h:2482
#define LVM_GETORIGIN
Definition: commctrl.h:2673
#define LVM_SETITEMPOSITION32
Definition: commctrl.h:2710
#define TCM_GETITEMW
Definition: commctrl.h:4038
#define TCM_INSERTITEMA
Definition: commctrl.h:4051
struct tagNMHEADERA NMHEADERA
#define LVM_INSERTITEMW
Definition: commctrl.h:2409
#define LVM_GETITEMW
Definition: commctrl.h:2395
#define SBM_SETRANGE
Definition: winuser.h:2117
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1689
#define WM_CREATE
Definition: winuser.h:1636
#define WM_SIZE
Definition: winuser.h:1639
#define SBM_GETRANGE
Definition: winuser.h:2115
#define WM_DRAWITEM
Definition: winuser.h:1673
#define WM_NCCREATE
Definition: winuser.h:1711
struct tagSTYLESTRUCT * LPSTYLESTRUCT
BOOL WINAPI IsWindowUnicode(_In_ HWND)
#define WM_MEASUREITEM
Definition: winuser.h:1674
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
#define WM_NCCALCSIZE
Definition: winuser.h:1713
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1690
#define CFM_PROTECTED
Definition: richedit.h:336
#define CFM_STRIKEOUT
Definition: richedit.h:335
#define CFE_STRIKEOUT
Definition: richedit.h:409
#define CFE_BOLD
Definition: richedit.h:406
#define CFE_AUTOCOLOR
Definition: richedit.h:414
#define CFM_OFFSET
Definition: richedit.h:359
#define CFE_ITALIC
Definition: richedit.h:407
#define EM_SETCHARFORMAT
Definition: richedit.h:101
#define CFE_UNDERLINE
Definition: richedit.h:408
#define CFM_ITALIC
Definition: richedit.h:333
#define CFE_PROTECTED
Definition: richedit.h:410
#define CFM_SIZE
Definition: richedit.h:362
#define EM_EXSETSEL
Definition: richedit.h:88
#define CFM_BOLD
Definition: richedit.h:332
#define CFM_FACE
Definition: richedit.h:360
#define WM_NOTIFY
Definition: richedit.h:61
#define CFM_UNDERLINE
Definition: richedit.h:334
#define CFM_COLOR
Definition: richedit.h:361
static const SPY_NOTIFY * SPY_Bsearch_Notify(UINT code)
Definition: spy.c:2265
static void SPY_DumpMem(LPCSTR header, const UINT *q, INT len)
Definition: spy.c:2284
Definition: dcommon.idl:28
INT data_len
Definition: spy.c:2029
LPARAM lParam
Definition: spy.c:2028
WPARAM wParam
Definition: spy.c:2027
UINT msgnum
Definition: spy.c:2025
HWND msg_hwnd
Definition: spy.c:2026
LONG y
Definition: windef.h:130
LONG x
Definition: windef.h:129
HWND hwnd
Definition: winuser.h:3696
UINT flags
Definition: winuser.h:3702
HWND hwndInsertAfter
Definition: winuser.h:3697
LONG cpMax
Definition: richedit.h:501
LONG cpMin
Definition: richedit.h:500
Definition: style.c:91
ULONG_PTR itemData
Definition: winuser.h:3201
ULONG_PTR itemData
Definition: winuser.h:3754
PWINDOWPOS lppos
Definition: winuser.h:3707
UINT_PTR idFrom
Definition: winuser.h:3266
UINT code
Definition: winuser.h:3267
HWND hwndFrom
Definition: winuser.h:3265
const uint16_t * LPCWSTR
Definition: typedefs.h:57
#define HIWORD(l)
Definition: typedefs.h:247
#define LPPOINT
Definition: precomp.h:31
#define LPRECT
Definition: precomp.h:28
NTSYSAPI DWORD WINAPI RtlGetLastWin32Error(void)
Definition: error.c:132
NTSYSAPI void WINAPI RtlSetLastWin32Error(DWORD)

Referenced by SPY_EnterMessage(), and SPY_ExitMessage().

◆ SPY_EnterMessage()

void SPY_EnterMessage ( INT  iFlag,
HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 2619 of file spy.c.

2621{
2622 SPY_INSTANCE sp_e;
2623 int indent;
2624 DWORD save_error = RtlGetLastWin32Error();
2625
2626 if (!spy_init() || exclude_msg(msg)) return;
2627
2628 sp_e.msgnum = msg;
2629 sp_e.msg_hwnd = hWnd;
2630 sp_e.lParam = lParam;
2631 sp_e.wParam = wParam;
2632 SPY_GetWndName(&sp_e);
2633 SPY_GetMsgStuff(&sp_e);
2635
2636 /* each SPY_SENDMESSAGE must be complemented by call to SPY_ExitMessage */
2637 switch(iFlag)
2638 {
2640 TRACE("%*s(%p) %-16s [%04x] %s dispatched wp=%08lx lp=%08lx\n",
2641 indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
2642 sp_e.msg_name, (long)wParam, lParam);
2643 break;
2644
2645 case SPY_SENDMESSAGE:
2646 {
2647 char taskName[20];
2649
2650 if (tid == GetCurrentThreadId()) strcpy( taskName, "self" );
2651 else snprintf( taskName, sizeof(taskName), "tid %04ld", GetCurrentThreadId() );
2652
2653 TRACE("%*s(%p) %-16s [%04x] %s sent from %s wp=%08lx lp=%08lx\n",
2654 indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
2655 sp_e.msg_name, taskName, (long)wParam, lParam );
2656 SPY_DumpStructure(&sp_e, TRUE);
2657 }
2658 break;
2659
2660 case SPY_DEFWNDPROC:
2661 if (exclude_dwp()) return;
2662 TRACE("%*s(%p) DefWindowProc:[%04x] %s wp=%08lx lp=%08lx\n",
2663 indent, "", hWnd, msg, sp_e.msg_name, (long)wParam, lParam );
2664 break;
2665 }
2667 RtlSetLastWin32Error( save_error );
2668}
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
static const WCHAR indent[]
Definition: object.c:1231
static TfClientId tid
strcpy
Definition: string.h:131
static void set_indent_level(INT_PTR level)
Definition: spy.c:2055
static INT_PTR get_indent_level(void)
Definition: spy.c:2042
static void SPY_GetWndName(SPY_INSTANCE *sp_e)
Definition: spy.c:2206
static void SPY_DumpStructure(const SPY_INSTANCE *sp_e, BOOL enter)
Definition: spy.c:2318
static BOOL exclude_msg(UINT msg)
Definition: spy.c:2012
static void SPY_GetMsgStuff(SPY_INSTANCE *sp_e)
Definition: spy.c:2141
static BOOL spy_init(void)
Definition: spy.c:2555
#define SPY_INDENT_UNIT
Definition: spy.c:32
static BOOL exclude_dwp(void)
Definition: spy.c:2017
char msg_name[60]
Definition: spy.c:2030
WCHAR wnd_name[16]
Definition: spy.c:2032
#define SPY_DISPATCHMESSAGE
Definition: user32p.h:67
#define SPY_SENDMESSAGE
Definition: user32p.h:68
#define SPY_DEFWNDPROC
Definition: user32p.h:69
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:462
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
#define snprintf
Definition: wintirpc.h:48

Referenced by RealDefWindowProcA(), RealDefWindowProcW(), SendMessageTimeoutA(), and SendMessageTimeoutW().

◆ SPY_ExitMessage()

void SPY_ExitMessage ( INT  iFlag,
HWND  hWnd,
UINT  msg,
LRESULT  lReturn,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 2674 of file spy.c.

2676{
2677 SPY_INSTANCE sp_e;
2678 int indent;
2679 DWORD save_error = RtlGetLastWin32Error();
2680
2681 if (!TRACE_ON(message) || exclude_msg(msg) ||
2682 (exclude_dwp() && iFlag == SPY_RESULT_DEFWND))
2683 return;
2684
2685 sp_e.msgnum = msg;
2686 sp_e.msg_hwnd = hWnd;
2687 sp_e.lParam = lParam;
2688 sp_e.wParam = wParam;
2689 SPY_GetWndName(&sp_e);
2690 SPY_GetMsgStuff(&sp_e);
2691
2692 if ((indent = get_indent_level()))
2693 {
2696 }
2697
2698 switch(iFlag)
2699 {
2700 case SPY_RESULT_DEFWND:
2701 TRACE(" %*s(%p) DefWindowProc: [%04x] %s returned %08lx\n",
2702 indent, "", hWnd, msg, sp_e.msg_name, lReturn );
2703 break;
2704
2705 case SPY_RESULT_OK:
2706 TRACE(" %*s(%p) %-16s [%04x] %s returned %08lx\n",
2707 indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
2708 sp_e.msg_name, lReturn );
2709 SPY_DumpStructure(&sp_e, FALSE);
2710 break;
2711 }
2712 RtlSetLastWin32Error( save_error );
2713}
#define FALSE
Definition: types.h:117
#define TRACE_ON(x)
Definition: compat.h:75
Definition: tftpd.h:60
#define SPY_RESULT_OK
Definition: user32p.h:70
#define SPY_RESULT_DEFWND
Definition: user32p.h:72

Referenced by RealDefWindowProcA(), RealDefWindowProcW(), SendMessageTimeoutA(), and SendMessageTimeoutW().

◆ SPY_GetClassName()

static void SPY_GetClassName ( SPY_INSTANCE *  sp_e)
static

Definition at line 2124 of file spy.c.

2125{
2126 /* special code to detect a property sheet dialog */
2128 (GetPropW(sp_e->msg_hwnd, L"PropertySheetInfo"))) {
2130 }
2131 else {
2132 GetClassNameW(sp_e->msg_hwnd, sp_e->wnd_class, ARRAY_SIZE(sp_e->wnd_class));
2133 }
2134}
#define lstrcpyW
Definition: compat.h:749
#define L(x)
Definition: resources.c:13
static const WCHAR WC_PROPSHEETW[]
Definition: prsht.h:369
#define GetClassLongPtrW
Definition: winuser.h:4718
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define GCW_ATOM
Definition: winuser.h:669
WCHAR wnd_class[60]
Definition: spy.c:2031
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define WC_DIALOG
Definition: undocuser.h:13

Referenced by SPY_GetMsgStuff(), and SPY_GetWndName().

◆ SPY_GetMsgInternal()

static const char * SPY_GetMsgInternal ( UINT  msg)
static

Definition at line 2068 of file spy.c.

2069{
2070 if (msg <= SPY_MAX_MSGNUM)
2071 return MessageTypeNames[msg];
2072
2075
2076 if (msg >= TV_FIRST && msg <= TV_FIRST + SPY_MAX_TVMSGNUM)
2078
2081
2084
2087
2090#ifndef __REACTOS__
2091 if (msg >= WM_WINE_DESTROYWINDOW && msg <= WM_WINE_DESTROYWINDOW + SPY_MAX_WINEMSGNUM)
2092 return WINEMessageTypeNames[msg-WM_WINE_DESTROYWINDOW];
2093 if (msg >= WM_WINE_CLIPCURSOR && msg <= WM_WINE_CLIPCURSOR + SPY_MAX_WINE_DRIVER_MSGNUM)
2094 return wine_driver_message_type_names[msg-WM_WINE_CLIPCURSOR];
2095#endif
2096
2097 return NULL;
2098}
#define HDM_FIRST
Definition: commctrl.h:84
#define CCM_FIRST
Definition: commctrl.h:91
#define PGM_FIRST
Definition: commctrl.h:87
#define TV_FIRST
Definition: commctrl.h:83
#define TCM_FIRST
Definition: commctrl.h:85
#define LVM_FIRST
Definition: commctrl.h:82
static const char *const TVMessageTypeNames[SPY_MAX_TVMSGNUM+1]
Definition: spy.c:926
static const char *const TCMMessageTypeNames[SPY_MAX_TCMMSGNUM+1]
Definition: spy.c:1024
static const char *const PGMMessageTypeNames[SPY_MAX_PGMMSGNUM+1]
Definition: spy.c:1092
#define SPY_MAX_LVMMSGNUM
Definition: spy.c:736
static const char *const HDMMessageTypeNames[SPY_MAX_HDMMSGNUM+1]
Definition: spy.c:998
static const char *const CCMMessageTypeNames[SPY_MAX_CCMMSGNUM+1]
Definition: spy.c:1112
#define SPY_MAX_PGMMSGNUM
Definition: spy.c:1091
static const char *const MessageTypeNames[SPY_MAX_MSGNUM+1]
Definition: spy.c:36
static const char *const wine_driver_message_type_names[SPY_MAX_WINE_DRIVER_MSGNUM+1]
Definition: spy.c:1147
static const char *const WINEMessageTypeNames[SPY_MAX_WINEMSGNUM+1]
Definition: spy.c:1128
#define SPY_MAX_WINE_DRIVER_MSGNUM
Definition: spy.c:1146
static const char *const LVMMessageTypeNames[SPY_MAX_LVMMSGNUM+1]
Definition: spy.c:737
#define SPY_MAX_HDMMSGNUM
Definition: spy.c:997
#define SPY_MAX_TCMMSGNUM
Definition: spy.c:1023
#define SPY_MAX_WINEMSGNUM
Definition: spy.c:1127
#define SPY_MAX_CCMMSGNUM
Definition: spy.c:1111
#define SPY_MAX_TVMSGNUM
Definition: spy.c:925

Referenced by SPY_GetMsgStuff().

◆ SPY_GetMsgName()

const char * SPY_GetMsgName ( UINT  msg,
HWND  hWnd 
)

Definition at line 2232 of file spy.c.

2233{
2234 SPY_INSTANCE ext_sp_e;
2235 DWORD save_error = RtlGetLastWin32Error();
2236
2237 ext_sp_e.msgnum = msg;
2238 ext_sp_e.msg_hwnd = hWnd;
2239 ext_sp_e.lParam = 0;
2240 ext_sp_e.wParam = 0;
2241 ext_sp_e.wnd_class[0] = 0;
2242 SPY_GetMsgStuff(&ext_sp_e);
2243 RtlSetLastWin32Error( save_error );
2244 return wine_dbg_sprintf("%s", ext_sp_e.msg_name);
2245}
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:296

Referenced by ComboWndProc_common(), DefFrameProcW(), DefMDIChildProcA(), DefMDIChildProcW(), EditWndProc_common(), IntScrollHandleScrollEvent(), ListBoxWndProc_common(), and MDIClientWndProc_common().

◆ SPY_GetMsgStuff()

static void SPY_GetMsgStuff ( SPY_INSTANCE *  sp_e)
static

Definition at line 2141 of file spy.c.

2142{
2143 const USER_MSG *p;
2144 const char *msg_name = SPY_GetMsgInternal( sp_e->msgnum );
2145
2146 sp_e->data_len = 0;
2147 if (!msg_name)
2148 {
2149 INT i = 0;
2150
2151 if (sp_e->msgnum >= 0xc000)
2152 {
2153 if (GlobalGetAtomNameA( sp_e->msgnum, sp_e->msg_name+1, sizeof(sp_e->msg_name)-2 ))
2154 {
2155 sp_e->msg_name[0] = '\"';
2156 strcat( sp_e->msg_name, "\"" );
2157 return;
2158 }
2159 }
2160 if (!sp_e->wnd_class[0]) SPY_GetClassName(sp_e);
2161
2162#if DEBUG_SPY
2163 TRACE("looking class %s\n", debugstr_w(sp_e->wnd_class));
2164#endif
2165
2166#ifdef __REACTOS__
2167 while (cc_array[i].classname &&
2168 _wcsicmp(cc_array[i].classname, sp_e->wnd_class) != 0) i++;
2169#else
2170 while (cc_array[i].classname &&
2171 wcsicmp(cc_array[i].classname, sp_e->wnd_class) != 0) i++;
2172#endif
2173
2174 if (cc_array[i].classname)
2175 {
2176#if DEBUG_SPY
2177 TRACE("process class %s, first %p, last %p\n",
2178 debugstr_w(cc_array[i].classname), cc_array[i].classmsg,
2179 cc_array[i].lastmsg);
2180#endif
2181 p = SPY_Bsearch_Msg (cc_array[i].classmsg, cc_array[i].count, sp_e->msgnum);
2182 if (p) {
2183 lstrcpynA (sp_e->msg_name, p->name, sizeof(sp_e->msg_name));
2184 sp_e->data_len = p->len;
2185 return;
2186 }
2187 }
2188 if (sp_e->msgnum >= WM_USER && sp_e->msgnum <= WM_APP)
2189 snprintf( sp_e->msg_name, sizeof(sp_e->msg_name), "WM_USER+%d", sp_e->msgnum - WM_USER );
2190 else
2191 snprintf( sp_e->msg_name, sizeof(sp_e->msg_name), "%04x", sp_e->msgnum );
2192 }
2193 else
2194 {
2195 lstrcpynA(sp_e->msg_name, msg_name, sizeof(sp_e->msg_name));
2196 }
2197}
#define lstrcpynA
Definition: compat.h:751
#define wcsicmp
Definition: compat.h:15
UINT WINAPI GlobalGetAtomNameA(ATOM nAtom, LPSTR lpBuffer, int nSize)
Definition: atom.c:464
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:164
#define WM_APP
Definition: eventvwr.h:73
#define WM_USER
Definition: winuser.h:1923
WCHAR classname[128]
Definition: startup.c:15
strcat
Definition: string.h:92
static const CONTROL_CLASS cc_array[]
Definition: spy.c:1763
static void SPY_GetClassName(SPY_INSTANCE *sp_e)
Definition: spy.c:2124
static const USER_MSG * SPY_Bsearch_Msg(const USER_MSG *msgs, UINT count, UINT code)
Definition: spy.c:2103
static const char * SPY_GetMsgInternal(UINT msg)
Definition: spy.c:2068
Definition: spy.c:1423
int32_t INT
Definition: typedefs.h:58

Referenced by SPY_EnterMessage(), SPY_ExitMessage(), and SPY_GetMsgName().

◆ SPY_GetVKeyName()

const char * SPY_GetVKeyName ( WPARAM  wParam)

Definition at line 2250 of file spy.c.

2251{
2252 const char *vk_key_name;
2253
2255 vk_key_name = VK_KeyNames[wParam];
2256 else
2257 vk_key_name = "VK_???";
2258
2259 return vk_key_name;
2260}
static const char *const VK_KeyNames[SPY_MAX_VKKEYSNUM+1]
Definition: spy.c:1156
#define SPY_MAX_VKKEYSNUM
Definition: spy.c:1155

◆ SPY_GetWndName()

static void SPY_GetWndName ( SPY_INSTANCE *  sp_e)
static

Definition at line 2206 of file spy.c.

2207{
2208 INT len;
2209
2210 SPY_GetClassName( sp_e );
2211
2213 if(!len) /* get class name */
2214 {
2215 LPWSTR dst = sp_e->wnd_name;
2216 LPWSTR src = sp_e->wnd_class;
2217 int n = ARRAY_SIZE(sp_e->wnd_name) - 3;
2218 *dst++ = '{';
2219 while ((n-- > 0) && *src) *dst++ = *src++;
2220 *dst++ = '}';
2221 *dst = 0;
2222 }
2223}
GLdouble n
Definition: glext.h:7729
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
INT NTAPI NtUserInternalGetWindowText(HWND hWnd, LPWSTR lpString, INT nMaxCount)
Definition: window.c:4592
uint16_t * LPWSTR
Definition: typedefs.h:56

Referenced by SPY_EnterMessage(), and SPY_ExitMessage().

◆ spy_init()

static BOOL spy_init ( void  )
static

Definition at line 2555 of file spy.c.

2556{
2557 int i;
2558 char buffer[1024];
2559 HKEY hkey;
2560 char *exclude;
2561
2562 if (!TRACE_ON(message)) return FALSE;
2563
2564#ifdef __REACTOS__
2565 if (indent_tls_index == TLS_OUT_OF_INDEXES)
2566 {
2567 DWORD index = TlsAlloc();
2568 if (InterlockedCompareExchange((volatile LONG *) &indent_tls_index, index, TLS_OUT_OF_INDEXES ) != TLS_OUT_OF_INDEXES)
2569 TlsFree( index );
2570 }
2571#endif
2572
2573 if (spy_exclude) return TRUE;
2575
2576 /* @@ Wine registry key: HKCU\Software\Wine\Debug */
2577 if(!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Debug", &hkey))
2578 {
2579 DWORD type, count = sizeof(buffer);
2580
2581 buffer[0] = 0;
2582 if (!RegQueryValueExA(hkey, "SpyInclude", 0, &type, (LPBYTE) buffer, &count) &&
2583 strcmp( buffer, "INCLUDEALL" ))
2584 {
2585 TRACE("Include=%s\n", buffer );
2586 for (i = 0; i <= SPY_MAX_MSGNUM; i++)
2587 exclude[i] = (MessageTypeNames[i] && !strstr(buffer,MessageTypeNames[i]));
2588 }
2589
2590 count = sizeof(buffer);
2591 buffer[0] = 0;
2592 if (!RegQueryValueExA(hkey, "SpyExclude", 0, &type, (LPBYTE) buffer, &count))
2593 {
2594 TRACE("Exclude=%s\n", buffer );
2595 if (!strcmp( buffer, "EXCLUDEALL" ))
2596 for (i = 0; i <= SPY_MAX_MSGNUM; i++) exclude[i] = TRUE;
2597 else
2598 for (i = 0; i <= SPY_MAX_MSGNUM; i++)
2599 exclude[i] = (MessageTypeNames[i] && strstr(buffer,MessageTypeNames[i]));
2600 }
2601
2602 count = sizeof(buffer);
2603 if(!RegQueryValueExA(hkey, "SpyExcludeDWP", 0, &type, (LPBYTE) buffer, &count))
2604 exclude[SPY_MAX_MSGNUM + 1] = atoi(buffer);
2605
2606 RegCloseKey(hkey);
2607 }
2608
2609 if (InterlockedCompareExchangePointer( (void **)&spy_exclude, exclude, NULL ))
2610 HeapFree( GetProcessHeap(), 0, exclude );
2611
2612 return TRUE;
2613}
#define RegCloseKey(hKey)
Definition: registry.h:49
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3234
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4009
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1227
DWORD WINAPI DECLSPEC_HOTPATCH TlsAlloc(void)
Definition: thread.c:657
_ACRTIMP int __cdecl atoi(const char *)
Definition: string.c:1720
_ACRTIMP char *__cdecl strstr(const char *, const char *)
Definition: string.c:3420
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3324
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint buffer
Definition: glext.h:5915
GLuint index
Definition: glext.h:6031
#define InterlockedCompareExchangePointer
Definition: interlocked.h:144
#define InterlockedCompareExchange
Definition: interlocked.h:119
long LONG
Definition: pedump.c:60
unsigned char * LPBYTE
Definition: typedefs.h:53
#define TLS_OUT_OF_INDEXES
Definition: winbase.h:529
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by SPY_EnterMessage().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( message  )

Variable Documentation

◆ cc_array

const CONTROL_CLASS cc_array[]
static
Initial value:
= {
{0, 0, 0}
}
#define UPDOWN_CLASSW
Definition: commctrl.h:2124
#define REBARCLASSNAMEW
Definition: commctrl.h:1463
#define TOOLTIPS_CLASSW
Definition: commctrl.h:1707
#define WC_COMBOBOXEXW
Definition: commctrl.h:3786
static const WCHAR RICHEDIT_CLASS20W[]
Definition: richedit.h:50
static const WCHAR MSFTEDIT_CLASS[]
Definition: richedit.h:40
static const USER_MSG tooltips_array[]
Definition: spy.c:1580
static const USER_MSG updown_array[]
Definition: spy.c:1660
static const USER_MSG comboex_array[]
Definition: spy.c:1621
static const USER_MSG propsht_array[]
Definition: spy.c:1638
static const USER_MSG rebar_array[]
Definition: spy.c:1446
static const USER_MSG toolbar_array[]
Definition: spy.c:1484
static const USER_MSG richedit_array[]
Definition: spy.c:1680

Definition at line 1763 of file spy.c.

Referenced by SPY_GetMsgStuff().

◆ CCMMessageTypeNames

const char* const CCMMessageTypeNames[SPY_MAX_CCMMSGNUM+1]
static
Initial value:
=
{
NULL,
"CCM_SETBKCOLOR",
"CCM_SETCOLORSCHEME",
"CCM_GETCOLORSCHEME",
"CCM_GETDROPTARGET",
"CCM_SETUNICODEFORMAT",
"CCM_GETUNICODEFORMAT",
"CCM_SETVERSION",
"CCM_GETVERSION",
"CCM_SETNOTIFYWINDOW"
}

Definition at line 1112 of file spy.c.

Referenced by SPY_GetMsgInternal().

◆ comboex_array

const USER_MSG comboex_array[]
static
Initial value:
= {
}
#define CBEM_HASEDITCHANGED
Definition: commctrl.h:3845
#define CBEM_GETITEMW
Definition: commctrl.h:3848
#define CBEM_GETIMAGELIST
Definition: commctrl.h:3833
#define CBEM_SETITEMW
Definition: commctrl.h:3847
#define CBEM_GETCOMBOCONTROL
Definition: commctrl.h:3837
#define CBEM_SETEXTENDEDSTYLE
Definition: commctrl.h:3840
#define CBEM_SETIMAGELIST
Definition: commctrl.h:3832
#define CBEM_INSERTITEMA
Definition: commctrl.h:3831
#define CBEM_INSERTITEMW
Definition: commctrl.h:3846
#define CBEM_SETEXSTYLE
Definition: commctrl.h:3839
#define CBEM_GETITEMA
Definition: commctrl.h:3834
#define CBEM_GETEXTENDEDSTYLE
Definition: commctrl.h:3842
#define CBEM_SETITEMA
Definition: commctrl.h:3835
#define CBEM_GETEDITCONTROL
Definition: commctrl.h:3838
#define USM(a, b)
Definition: spy.c:1437

Definition at line 1621 of file spy.c.

◆ HDMMessageTypeNames

const char* const HDMMessageTypeNames[SPY_MAX_HDMMSGNUM+1]
static
Initial value:
=
{
"HDM_GETITEMCOUNT",
"HDM_INSERTITEMA",
"HDM_DELETEITEM",
"HDM_GETITEMA",
"HDM_SETITEMA",
"HDM_LAYOUT",
"HDM_HITTEST",
"HDM_GETITEMRECT",
"HDM_SETIMAGELIST",
"HDM_GETIMAGELIST",
"HDM_INSERTITEMW",
"HDM_GETITEMW",
"HDM_SETITEMW",
"HDM_ORDERTOINDEX",
"HDM_CREATEDRAGIMAGE",
"GETORDERARRAYINDEX",
"SETORDERARRAYINDEX",
"SETHOTDIVIDER"
}

Definition at line 998 of file spy.c.

Referenced by SPY_GetMsgInternal().

◆ LVMMessageTypeNames

const char* const LVMMessageTypeNames[SPY_MAX_LVMMSGNUM+1]
static

Definition at line 737 of file spy.c.

Referenced by SPY_GetMsgInternal().

◆ MessageTypeNames

const char* const MessageTypeNames[SPY_MAX_MSGNUM+1]
static

Definition at line 36 of file spy.c.

Referenced by SPY_GetMsgInternal(), and spy_init().

◆ PGMMessageTypeNames

const char* const PGMMessageTypeNames[SPY_MAX_PGMMSGNUM+1]
static
Initial value:
=
{
NULL,
"PGM_SETCHILD",
"PGM_RECALCSIZE",
"PGM_FORWARDMOUSE",
"PGM_SETBKCOLOR",
"PGM_GETBKCOLOR",
"PGM_SETBORDER",
"PGM_GETBORDER",
"PGM_SETPOS",
"PGM_GETPOS",
"PGM_SETBUTTONSIZE",
"PGM_GETBUTTONSIZE",
"PGM_GETBUTTONSTATE",
"PGM_GETDROPTARGET"
}

Definition at line 1092 of file spy.c.

Referenced by SPY_GetMsgInternal().

◆ propsht_array

const USER_MSG propsht_array[]
static
Initial value:
= {
}
#define PSM_GETTABCONTROL
Definition: prsht.h:80
#define PSM_CHANGED
Definition: prsht.h:164
#define PSM_ISDIALOGMESSAGE
Definition: prsht.h:96
#define PSM_SETWIZBUTTONS
Definition: prsht.h:157
#define PSM_REMOVEPAGE
Definition: prsht.h:166
#define PSM_ADDPAGE
Definition: prsht.h:165
#define PSM_UNCHANGED
Definition: prsht.h:159
#define PSM_GETCURRENTPAGEHWND
Definition: prsht.h:81
#define PSM_RESTARTWINDOWS
Definition: prsht.h:163
#define PSM_SETTITLEA
Definition: prsht.h:168
#define PSM_SETCURSELID
Definition: prsht.h:104
#define PSM_SETTITLEW
Definition: prsht.h:169
#define PSM_SETFINISHTEXTW
Definition: prsht.h:105
#define PSM_SETFINISHTEXTA
Definition: prsht.h:106
#define PSM_CANCELTOCLOSE
Definition: prsht.h:161
#define PSM_APPLY
Definition: prsht.h:158
#define PSM_SETCURSEL
Definition: prsht.h:167
#define PSM_PRESSBUTTON
Definition: prsht.h:100
#define PSM_REBOOTSYSTEM
Definition: prsht.h:162
#define PSM_QUERYSIBLINGS
Definition: prsht.h:160

Definition at line 1638 of file spy.c.

◆ rebar_array

const USER_MSG rebar_array[]
static

Definition at line 1446 of file spy.c.

◆ richedit_array

const USER_MSG richedit_array[]
static

Definition at line 1680 of file spy.c.

◆ spnfy_array

const SPY_NOTIFY spnfy_array[]
static

Definition at line 1794 of file spy.c.

Referenced by SPY_Bsearch_Notify().

◆ spy_exclude

unsigned char* spy_exclude
static

Definition at line 2010 of file spy.c.

Referenced by exclude_dwp(), exclude_msg(), and spy_init().

◆ TCMMessageTypeNames

const char* const TCMMessageTypeNames[SPY_MAX_TCMMSGNUM+1]
static

Definition at line 1024 of file spy.c.

Referenced by SPY_GetMsgInternal().

◆ toolbar_array

const USER_MSG toolbar_array[]
static

Definition at line 1484 of file spy.c.

◆ tooltips_array

const USER_MSG tooltips_array[]
static

Definition at line 1580 of file spy.c.

◆ TVMessageTypeNames

const char* const TVMessageTypeNames[SPY_MAX_TVMSGNUM+1]
static

Definition at line 926 of file spy.c.

Referenced by SPY_GetMsgInternal().

◆ updown_array

const USER_MSG updown_array[]
static
Initial value:
= {
}
#define UDM_SETACCEL
Definition: commctrl.h:2152
#define UDM_GETBUDDY
Definition: commctrl.h:2151
#define UDM_SETPOS
Definition: commctrl.h:2148
#define UDM_GETACCEL
Definition: commctrl.h:2153
#define UDM_SETRANGE
Definition: commctrl.h:2146
#define UDM_GETRANGE
Definition: commctrl.h:2147
#define UDM_SETBASE
Definition: commctrl.h:2154
#define UDM_GETBASE
Definition: commctrl.h:2155
#define UDM_SETBUDDY
Definition: commctrl.h:2150
#define UDM_GETRANGE32
Definition: commctrl.h:2157
#define UDM_SETRANGE32
Definition: commctrl.h:2156
#define UDM_GETPOS
Definition: commctrl.h:2149
#define UDM_GETPOS32
Definition: commctrl.h:2161
#define UDM_SETPOS32
Definition: commctrl.h:2160

Definition at line 1660 of file spy.c.

◆ VK_KeyNames

const char* const VK_KeyNames[SPY_MAX_VKKEYSNUM+1]
static

Definition at line 1156 of file spy.c.

Referenced by SPY_GetVKeyName().

◆ wine_driver_message_type_names

const char* const wine_driver_message_type_names[SPY_MAX_WINE_DRIVER_MSGNUM+1]
static
Initial value:
=
{
"WM_WINE_CLIPCURSOR",
"WM_WINE_SETCURSOR",
}

Definition at line 1147 of file spy.c.

Referenced by SPY_GetMsgInternal().

◆ WINEMessageTypeNames

const char* const WINEMessageTypeNames[SPY_MAX_WINEMSGNUM+1]
static
Initial value:
=
{
"WM_WINE_DESTROYWINDOW",
"WM_WINE_SETWINDOWPOS",
"WM_WINE_SHOWWINDOW",
"WM_WINE_SETPARENT",
"WM_WINE_SETWINDOWLONG",
"WM_WINE_SETSTYLE",
"WM_WINE_SETACTIVEWINDOW",
"WM_WINE_KEYBOARD_LL_HOOK",
"WM_WINE_MOUSE_LL_HOOK",
"WM_WINE_IME_NOTIFY",
"WM_WINE_WINDOW_STATE_CHANGED",
"WM_WINE_UPDATEWINDOWSTATE",
"WM_WINE_TRACKMOUSEEVENT",
"WM_WINE_SETPIXELFORMAT",
}

Definition at line 1128 of file spy.c.

Referenced by SPY_GetMsgInternal().