From ac8e75284af04f1d3d3dc2d51c680cba0c03b366 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Wed, 15 Jan 2003 00:51:38 +0000 Subject: [PATCH] Fail SetMenuItemInfo if both MFT_BITMAP and MFT_SEPARATOR are specified (an api violation). --- controls/menu.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/controls/menu.c b/controls/menu.c index f80336b06c..89bb876315 100644 --- a/controls/menu.c +++ b/controls/menu.c @@ -4275,14 +4275,19 @@ BOOL WINAPI SetMenuItemInfoA(HMENU hmenu, UINT item, BOOL bypos, const MENUITEMINFOA *lpmii) { if ((lpmii->fType & (MF_HILITE|MF_POPUP)) || (lpmii->fState)) { - /* QuickTime does pass invalid data into SetMenuItemInfo. - * do some of the checks Windows does. - */ - WARN("Bad masks for type (0x%08x) or state (0x%08x)\n", - lpmii->fType,lpmii->fState ); - return FALSE; + /* QuickTime does pass invalid data into SetMenuItemInfo. + * do some of the checks Windows does. + */ + WARN("Bad masks (0x%08x) for type (0x%08x) or state (0x%08x)\n", + lpmii->fMask, lpmii->fType,lpmii->fState ); } + /* is the app setting both MFT_BITMAP and MFT_SEPARATOR (which is wrong)? */ + if (lpmii->fType & (MFT_BITMAP | MFT_SEPARATOR)) { + WARN("fType contains MFT_BITMAP and MFT_SEPARATOR, API violation\n"); + return FALSE; + } + return SetMenuItemInfo_common(MENU_FindItem(&hmenu, &item, bypos? MF_BYPOSITION : 0), (const MENUITEMINFOW *)lpmii, FALSE); } -- 2.32.0.93.g670b81a890