Module: wine Branch: master Commit: 4189a89d41caa63df756c4c8c596c7fd01019527 URL: http://source.winehq.org/git/wine.git/?a=commit;h=4189a89d41caa63df756c4c8c5...
Author: Patrik Stridvall patrik@stridvall.se Date: Sat Dec 23 20:38:13 2006 +0100
user32: Show the GCL{,P}_* constant names in debug messages.
---
dlls/user32/class.c | 3 ++- dlls/user32/spy.c | 35 +++++++++++++++++++++++++++++++++++ dlls/user32/user_private.h | 1 + 3 files changed, 38 insertions(+), 1 deletions(-)
diff --git a/dlls/user32/class.c b/dlls/user32/class.c index 61edcc6..9817735 100644 --- a/dlls/user32/class.c +++ b/dlls/user32/class.c @@ -673,7 +673,8 @@ static ULONG_PTR CLASS_GetClassLong( HWN case GCLP_HICONSM: case GCLP_WNDPROC: case GCLP_MENUNAME: - FIXME( "offset %d not supported on other process window %p\n", offset, hwnd ); + FIXME( "offset %d (%s) not supported on other process window %p\n", + offset, SPY_GetClassLongOffsetName(offset), hwnd ); SetLastError( ERROR_INVALID_HANDLE ); break; case GCL_STYLE: diff --git a/dlls/user32/spy.c b/dlls/user32/spy.c index 451b0b2..164101e 100644 --- a/dlls/user32/spy.c +++ b/dlls/user32/spy.c @@ -44,6 +44,24 @@ WINE_DEFAULT_DEBUG_CHANNEL(message);
#define DEBUG_SPY 0
+static const char * const ClassLongOffsetNames[] = +{ + "GCLP_MENUNAME", /* -8 */ + "GCLP_HBRBACKGROUND", /* -10 */ + "GCLP_HCURSOR", /* -12 */ + "GCLP_HICON", /* -14 */ + "GCLP_HMODULE", /* -16 */ + "GCL_CBWNDEXTRA", /* -18 */ + "GCL_CBCLSEXTRA", /* -20 */ + "?", + "GCLP_WNDPROC", /* -24 */ + "GCL_STYLE", /* -26 */ + "?", + "?", + "GCW_ATOM", /* -32 */ + "GCLP_HICONSM", /* -34 */ +}; + static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = { "WM_NULL", /* 0x00 */ @@ -2026,6 +2044,23 @@ static const USER_MSG *SPY_Bsearch_Msg( }
/*********************************************************************** + * SPY_GetClassLongOffsetName + * + * Gets the name of a class long offset. + */ +const char *SPY_GetClassLongOffsetName( INT offset ) +{ + INT index; + if (offset < 0 && offset % 2 == 0 && ((index = -(offset + 8) / 2) < + sizeof(ClassLongOffsetNames) / sizeof(*ClassLongOffsetNames))) + { + return ClassLongOffsetNames[index]; + } + + return "?"; +} + +/*********************************************************************** * SPY_GetClassName * * Sets the value of "wnd_class" member of the instance structure. diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index ae27884..f939e4e 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -239,6 +239,7 @@ extern BOOL USER_SetWindowPos( WINDOWPOS #define SPY_RESULT_DEFWND16 0x0004 #define SPY_RESULT_DEFWND 0x0005
+extern const char *SPY_GetClassLongOffsetName( INT offset ); extern const char *SPY_GetMsgName( UINT msg, HWND hWnd ); extern const char *SPY_GetVKeyName(WPARAM wParam); extern void SPY_EnterMessage( INT iFlag, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );