Add check to SetMenuItemInfo

Dmitry Timoshkov dmitry at baikal.ru
Wed Jan 15 19:30:25 CST 2003


"Alistair Leslie" <aleslie at neumaflo.com.au> wrote:

> Reading about the MENUITEMINFO structure.
> Take from MSDN
> The MFT_BITMAP, MFT_SEPARATOR, and MFT_STRING values cannot be combined with
> one another.

In that case the code which verifies MENUITEMINFO fields could be generalized.
All existing checks in SetMenuItemInfoA should be removed and something like
this should be added to SetMenuItemInfo_common:

if (lpmii->fMask & MIIM_TYPE )
{
    if (lpmii->fType & MFT_BITMAP)
    {
        if (lpmii->fType & (MFT_SEPARATOR | MFT_STRING))
            return FALSE;
    }
    else if (lpmii->fType & MFT_SEPARATOR)
    {
        if (lpmii->fType & (MFT_BITMAP | MFT_STRING))
            return FALSE;
    }
    else if (lpmii->fType & MFT_STRING)
    {
        if (lpmii->fType & (MFT_BITMAP | MFT_SEPARATOR))
            return FALSE;
    }
}

Mike, could you please try this approach and report whether it helps?

-- 
Dmitry.






More information about the wine-devel mailing list