Module: wine Branch: master Commit: 81fb745e407fa297fdb8167d4f3b8acbe327308c URL: http://source.winehq.org/git/wine.git/?a=commit;h=81fb745e407fa297fdb8167d4f...
Author: Martin Payne development@martinpayne.me.uk Date: Wed Dec 13 10:24:32 2017 +0000
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
---
dlls/user.exe16/user.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/user.exe16/user.c b/dlls/user.exe16/user.c index 729e973..f7d4109 100644 --- a/dlls/user.exe16/user.c +++ b/dlls/user.exe16/user.c @@ -2405,6 +2405,10 @@ BOOL16 WINAPI InsertMenu16( HMENU16 hMenu, UINT16 pos, UINT16 flags, if ((pos == (UINT16)-1) && (flags & MF_BYPOSITION)) pos32 = (UINT)-1; if (IS_MENU_STRING_ITEM(flags) && 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 ); }