From 0bab3a1048c7aba13e36540e6f8fc400835cc1a6 Mon Sep 17 00:00:00 2001 From: Roy Tam Date: Sat, 21 Jan 2023 11:42:48 +0800 Subject: [PATCH] [NTUSER][USER32] Set WM_CONTEXTMENU's wParam to the child window's handle Cherry-picked from https://github.com/wine-mirror/wine/commit/3af8415ca9dc50e6c394c1001aad97db5f514069 CORE-18801 --- win32ss/user/ntuser/defwnd.c | 2 +- win32ss/user/user32/windows/defwnd.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/win32ss/user/ntuser/defwnd.c b/win32ss/user/ntuser/defwnd.c index 27929de7dbe..0faadbce3f9 100644 --- a/win32ss/user/ntuser/defwnd.c +++ b/win32ss/user/ntuser/defwnd.c @@ -738,7 +738,7 @@ IntDefWindowProc( { if (Wnd->style & WS_CHILD) { - co_IntSendMessage(UserHMGetHandle(IntGetParent(Wnd)), Msg, wParam, lParam); + co_IntSendMessage(UserHMGetHandle(IntGetParent(Wnd)), Msg, (WPARAM)UserHMGetHandle(Wnd), lParam); } else { diff --git a/win32ss/user/user32/windows/defwnd.c b/win32ss/user/user32/windows/defwnd.c index 2433178a49f..0a976bf50ee 100644 --- a/win32ss/user/user32/windows/defwnd.c +++ b/win32ss/user/user32/windows/defwnd.c @@ -390,11 +390,11 @@ User32DefWindowProc(HWND hWnd, { if (bUnicode) { - SendMessageW(GetParent(hWnd), Msg, wParam, lParam); + SendMessageW(GetParent(hWnd), Msg, (WPARAM)hWnd, lParam); } else { - SendMessageA(GetParent(hWnd), WM_CONTEXTMENU, wParam, lParam); + SendMessageA(GetParent(hWnd), Msg, (WPARAM)hWnd, lParam); } } else