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.
This commit is contained in:
Tim Clem 2023-06-23 13:00:49 -07:00 committed by Alexandre Julliard
parent 5b11157ecf
commit 9874807564

View file

@ -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;