user.exe16: Fix handling of 16-bit HBITMAPs in InsertMenu16.

Signed-off-by: Martin Payne <development@martinpayne.me.uk>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Martin Payne 2017-12-13 10:24:32 +00:00 committed by Alexandre Julliard
parent b9f32e1672
commit 81fb745e40
1 changed files with 4 additions and 0 deletions

View File

@ -2405,6 +2405,10 @@ BOOL16 WINAPI InsertMenu16( HMENU16 hMenu, UINT16 pos, UINT16 flags,
if ((pos == (UINT16)-1) && (flags & MF_BYPOSITION)) pos32 = (UINT)-1; if ((pos == (UINT16)-1) && (flags & MF_BYPOSITION)) pos32 = (UINT)-1;
if (IS_MENU_STRING_ITEM(flags) && data) if (IS_MENU_STRING_ITEM(flags) && data)
return InsertMenuA( HMENU_32(hMenu), pos32, flags, id, MapSL(data) ); return InsertMenuA( HMENU_32(hMenu), pos32, flags, id, MapSL(data) );
/* If "data" is an HBITMAP, the high WORD will contain the application's DGROUP selector if the
* application cast (LPSTR)hBitmap rather than (LPSTR)(LONG)hBitmap. */
if (flags & MF_BITMAP) data = (SEGPTR)HBITMAP_32(LOWORD(data));
return InsertMenuA( HMENU_32(hMenu), pos32, flags, id, (LPSTR)data ); return InsertMenuA( HMENU_32(hMenu), pos32, flags, id, (LPSTR)data );
} }