Commit 2c75490c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard
Browse files

win32u: Use NtUserMessageCall for NtUserSpyGetMsgName.

Instead of leaking a kernel pointer.
parent 8bb71922
Pipeline #1098 skipped
......@@ -352,7 +352,9 @@ BOOL WINAPI ShutdownBlockReasonDestroy(HWND hwnd)
const char *SPY_GetMsgName( UINT msg, HWND hwnd )
{
return (const char *)NtUserCallHwndParam( hwnd, msg, NtUserSpyGetMsgName );
char buf[128];
NtUserMessageCall( hwnd, msg, ARRAYSIZE(buf), 0, buf, NtUserSpyGetMsgName, FALSE );
return wine_dbg_sprintf( "%s", buf );
}
void SPY_EnterMessage( INT flag, HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
......
......@@ -2960,7 +2960,7 @@ LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa
return send_notify_message( hwnd, msg, wparam, lparam, ansi );
case NtUserSendMessageCallback:
return send_message_callback( hwnd, msg, wparam, lparam, (void *)result_info, ansi );
return send_message_callback( hwnd, msg, wparam, lparam, result_info, ansi );
case NtUserClipboardWindowProc:
return user_driver->pClipboardWindowProc( hwnd, msg, wparam, lparam );
......@@ -2978,6 +2978,10 @@ LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa
spy_enter_message( ansi, hwnd, msg, wparam, lparam );
return 0;
case NtUserSpyGetMsgName:
lstrcpynA( result_info, debugstr_msg_name( msg, hwnd ), wparam );
return 0;
case NtUserSpyExit:
spy_exit_message( ansi, hwnd, msg, (LPARAM)result_info, wparam, lparam );
return 0;
......
......@@ -5578,9 +5578,6 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code )
return set_window_style( hwnd, style->styleNew, style->styleOld );
}
case NtUserSpyGetMsgName:
return (UINT_PTR)debugstr_msg_name( param, hwnd );
default:
FIXME( "invalid code %u\n", code );
return 0;
......
......@@ -297,8 +297,9 @@ enum
/* Wine-specific exports */
NtUserClipboardWindowProc = 0x0300,
NtUserGetDispatchParams = 0x3001,
NtUserSpyEnter = 0x0302,
NtUserSpyExit = 0x0303,
NtUserSpyGetMsgName = 0x3002,
NtUserSpyEnter = 0x0303,
NtUserSpyExit = 0x0304,
};
/* NtUserThunkedMenuItemInfo codes */
......@@ -1261,7 +1262,6 @@ enum
NtUserCallHwndParam_ShowOwnedPopups,
/* temporary exports */
NtUserSetWindowStyle,
NtUserSpyGetMsgName,
};
static inline BOOL NtUserClientToScreen( HWND hwnd, POINT *pt )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment