Add check to SetMenuItemInfo

Dmitry Timoshkov dmitry at baikal.ru
Wed Jan 15 00:04:44 CST 2003


"Mike Hearn" <m.hearn at signal.qinetiq.com> wrote:

> Fail SetMenuItemInfo if both MFT_BITMAP and MFT_SEPARATOR are
> specified (an api violation).

I thought that Alexandre will not commit this patch, since it's
obviously wrong.

> + if (lpmii->fType & (MFT_BITMAP | MFT_SEPARATOR)) {
> + WARN("fType contains MFT_BITMAP and MFT_SEPARATOR, API violation\n");
> + return FALSE;
> + }

You are testing here whether either MFT_BITMAP or MFT_SEPARATOR is set,
which is perfectly valid to specify one of them. If you want to test
whether both flags are set simultaneously then use something like this:

if ((lpmii->fType & (MFT_BITMAP | MFT_SEPARATOR)) == (MFT_BITMAP | MFT_SEPARATOR))

A conformance test to show the real behaviour is urgently required.

-- 
Dmitry.






More information about the wine-devel mailing list