Commit 98748075 authored by Tim Clem's avatar Tim Clem Committed by Alexandre Julliard

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.
parent 5b11157e
......@@ -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;
......
Markdown is supported
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