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.
Thanks, Chris
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.
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.
I'm saying that the check for IS_STRING_ITEM seems like it should be removed. IS_STRING_ITEM already masks off a lot of other bit fields, so if the bit fields were quite bogus there is a good chance that IS_STRING_TYPE could actually return TRUE but the flags could be quite incorrect. If anything we could replace it with a check that says we can be only one of the available types and not more than one although I'm not sure if this case is always valid. Otherwise from the trace it just looks like the traditional way of defining a separator is to define a null string and this app just decided to use MF_SEPARATOR. I'm surprised even that we haven't gotten this menu error a lot in the past since it seems logical to set the MF_SEPARATOR flag if you want a separator, which is kind of why I posted...
Chris
But you might want to make sure that *only* this case is being disregarded; any other anomalies should trigger the alarm line.