menu resource parsing question...

Andreas Mohr andi at rhlx01.fht-esslingen.de
Sun Nov 3 03:39:05 CST 2002


On Sat, Nov 02, 2002 at 09:07:08PM -0500, Chris Morgan wrote:
> Upon the testing of Kazaa lite I ran into numerous errors like:
> err:menu:MENU_ParseResource not a string item, flags: 0x0800
> 
> These entries appear to be intended as separators and in fact the flag of 
> 0x800 is MF_SEPARATOR.  The code in question is :
> 
>         if (!IS_STRING_ITEM(flags))
>             ERR("not a string item, flags: 0x%04x\n", flags );
> 
> Where IS_STRING_ITEM is a macro:
> 	#define IS_STRING_ITEM(flags) (MENU_ITEM_TYPE ((flags)) == MF_STRING)
> 
> And:
> #define MENU_ITEM_TYPE(flags) \
>   ((flags) & (MF_STRING | MF_BITMAP | MF_OWNERDRAW | MF_SEPARATOR))
> 
> So, what appears to be occuring is that Kazaa is passing in MF_SEPARATOR as a 
> flag and wine expects instead to get a MF_STRING with a string of null and in 
> MENU_SetItemData() it does 'flags |= MF_SEPARATOR;'
> 
> I'm only posting to wine-devel because this check has been in the code since 
> the initial import into cvs and I wanted to see if anyone knew more of the 
> background on the issue.  The fix is pretty simple, just ignore the fact that 
> IS_STRING_ITEM() returns false.  The rest should be taken care of by the 
> existing checks.
Hmm, so if I understand you correctly: simply make the ERR a WARN ?
Or does that negative IS_STRING_ITEM test really make a difference in code,
too ?
In this case that'd probably have to be changed, too.

But you might want to make sure that *only* this case is being disregarded;
any other anomalies should trigger the alarm line.

-- 
"My attitude is, everybody should try competing with Microsoft once in their life. Once."
- Marc Andreessen, former Netscape lead employee, in a "browser wars" interview



More information about the wine-devel mailing list