[PATCH v2 1/2] user32: Fix menu item rectangle calculation in GetMenuItemRect().

Alexandre Julliard julliard at winehq.org
Mon Jul 16 09:50:54 CDT 2018


Zhiyi Zhang <zzhang at codeweavers.com> writes:

> @@ -5326,7 +5327,14 @@ BOOL WINAPI GetMenuItemRect(HWND hwnd, HMENU hMenu, UINT uItem, RECT *rect)
>      OffsetRect(rect, menu->items_rect.left, menu->items_rect.top);
>      release_menu_ptr(menu);
>  
> -    MapWindowPoints(hwnd, 0, (POINT *)rect, 2);
> +    /* Popup menu item draws in the client area */
> +    if (menu->wFlags & MF_POPUP) MapWindowPoints(hwnd, 0, (POINT *)rect, 2);

You shouldn't access the menu pointer after it has been released.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list