Module: wine Branch: master Commit: 98748075647820da9a10079061c1748b6a16047f URL: https://gitlab.winehq.org/wine/wine/-/commit/98748075647820da9a10079061c1748...
Author: Tim Clem tclem@codeweavers.com Date: Fri Jun 23 13:00:49 2023 -0700
winemac.drv: Don't expect an internal driver message to set last error.
NtUserMessageCall(..., NtUserSendDriverMessage) does not ensure the validity of the hwnd, so this check will incorrectly fail if the last error was ERROR_INVALID_WINDOW_HANDLE by coincidence. The notify_owner call immediately following this code will catch a destroyed owner hwnd.
---
dlls/winemac.drv/systray.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/dlls/winemac.drv/systray.c b/dlls/winemac.drv/systray.c index 8b3452e7540..42ffe49f563 100644 --- a/dlls/winemac.drv/systray.c +++ b/dlls/winemac.drv/systray.c @@ -342,13 +342,7 @@ void macdrv_status_item_mouse_button(const macdrv_event *event) else if (event->status_item_mouse_button.count % 2 == 0) msg += WM_LBUTTONDBLCLK - WM_LBUTTONDOWN;
- if (!send_message(icon->owner, WM_MACDRV_ACTIVATE_ON_FOLLOWING_FOCUS, 0, 0) && - RtlGetLastWin32Error() == ERROR_INVALID_WINDOW_HANDLE) - { - WARN("window %p was destroyed, removing icon 0x%x\n", icon->owner, icon->id); - delete_icon(icon); - return; - } + send_message(icon->owner, WM_MACDRV_ACTIVATE_ON_FOLLOWING_FOCUS, 0, 0);
if (!notify_owner(icon, msg, event->status_item_mouse_button.x, event->status_item_mouse_button.y)) return;